HTTP status code 400, implying the request was not understood by the server and should not be redone without modifications.
Questions tagged [bad-request]
641 questions
6
votes
1 answer
Spring MVC Request body error handling
While using @RequestBody StreamSource found out, that if xml in request body in not valid StreamSource throws an Exception(resulting in 400 Bad Request) and i'm not able to handle it(tell client what is bad).
Is there a way to handle such exception?
user253202
6
votes
2 answers
HTTP 400 Bad Request when calling WCF Service Operation?
When I call http://localhost/TestService.svc/GetColors, I get a Http (400) Bad Request. When I run this in fiddler, I also get Bad Request. When I invoke the service through the wcf test client, it works fine though. What could cause…

Xaisoft
- 45,655
- 87
- 279
- 432
6
votes
1 answer
Ampersand in image urls MVC result in A potentially dangerous Request.Path
I have a bunch of images that contain ampersands in their names.
My site is built on Asp.net MVC3.
When I try to view the image with they urls below my site returns and error.
Example urls:
www.somesite.com/myimages/an-%26-image.jpg…

Dave
- 3,812
- 5
- 31
- 39
6
votes
3 answers
Java/Spring > Handle Bad Request response for controller method with @RequestBody when no body is sent in request
long story short: I'm creating API that is supposed to be 100% REST.
I'm trying to overwrite default response for the following case:
I've got a method in my @RestController that has @RequestBody as an attribute
@RequestMapping(value = {"register"},…

mr_m1m3
- 323
- 1
- 2
- 12
6
votes
1 answer
Google API token endpoint POST returns Bad Request 400
I am trying to exchange a one-time Google Plus Authorization code for an access token. But I keep on getting a 400 Bad Request. I am using VB.NET. Here is the code:
'We should now have a "good" one-time authorization code stored in…

Steve Silberberg
- 277
- 3
- 18
6
votes
1 answer
Can Tomcat accept HTTP 1.1 requests without a Host header?
HTTP 1.1 states:
"A client MUST include a Host header field in all HTTP/1.1 request messages"
However, the machines I am working on send out this exact POST (containing coordinates), which I do not have access to change:
POST /touch…

user1684196
- 61
- 1
- 3
6
votes
1 answer
How to log/debug bad requests in tomcat?
In our system (closed system, java web application in tomcat 6 as server, java fat clients) our clients show occasionally "400 - Bad Request" responses. I would like to debug this on the server side, but since the requests seem to be invalid, I…

mkraemerx
- 1,713
- 2
- 17
- 21
5
votes
2 answers
Add detail message to ASP.NET Core 3.1 standard JSON BadRequest response
I have a controller in my ASP.NET Core 3.1 app that returns BadRequest() in one of the cases.
By default it produces the json response:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "Bad Request",
"status": 400,
…

Sergey Atroshchenko
- 73
- 2
- 8
5
votes
1 answer
Asp.net MVC core Bad Request - Request Too Long HTTP Error 400. The size of the request headers is too long
Facing an issue with MVC core 2.0 web application on application startup in the browser it throwing a Bad Request - Request Too Long and HTTP Error 400, The size of the request headers is too long. Even though I cleared all the cookies. First time…

Harish Nayak
- 348
- 3
- 18
5
votes
2 answers
How can I customize HTTP 400 responses for parse errors?
I've written a REST API service that requires that all responses be JSON. However, when the Go HTTP request parser encounters an error, it returns 400 as a plain text response without ever calling my handlers. Example:
> curl -i -H 'Authorization:…

theory
- 9,178
- 10
- 59
- 129
5
votes
3 answers
Delphi Google oauth2 token request using Indy HTTP get 400 Bad Request
I am trying to request access and refresh tokens from Google using oauth2, all I am getting is a "HTTP/1.1 400 Bad Request" error.
I am using IdHTTP in Delphi XE5 with the IdSSLIOHandlerSocketOpenSSL handler. I have got my Client ID, Client Secret…

Alan Finch
- 101
- 1
- 8
5
votes
1 answer
Debugging 400 Bad Request response
In my MVC application, when a POST request is sent to the server (via jQuery) and a validation error occurs, a 400 Bad Request is returned, as intended:
HTTP/1.1 400 Bad Request
Cache-Control: private
Content-Type: application/json;…

matk
- 1,528
- 2
- 14
- 25
5
votes
0 answers
Bad Request. Your browser sent a request that this server could not understand.Request header field is missing ':' separator
I am writing the the Java code for HTTP Proxy application. In that browser request is not send properly, so server is giving response as
Bad Request Your browser sent a request that this server could not understand.Request header field is missing…

Somnath
- 51
- 1
- 4
5
votes
1 answer
Handling Rails ActionController::BadRequest
So, going to http://localhost:3000/%ED will throw ActionController::BadRequest.
But what I really want if return a 404 page (like most websites do).
For instance, Twitter will say:
Invalid Unicode value in one or more parameters /%ED
And me I get…

Dorian
- 22,759
- 8
- 120
- 116
5
votes
1 answer
Getting 400 bad request reason:required from google cloud stoarge json api
I am attempting to upload a file (png in this this example) to google cloud storage but my request fails with the following 400 Bad Request response.
{
"error": {
"errors": [
{
"domain": "global",
"reason": "required",
"message":…

dkackman
- 15,179
- 13
- 69
- 123