Questions tagged [http-status-code-400]

400 Bad Request. Add this tag to a question if your requests receive this answer.

The request could not be understood by the server due to malformed syntax. The client should not repeat the request without modifications.

See also RFC2616.

806 questions
3
votes
1 answer

When should an API throw a 4xx status code (error) and when a 5xx?

This is a theoretical question. I believe I know the answer but I've received contradicting answers, so I figured I'd ask here. On the W3C site it says: Client Error 4xx The 4xx class of status code is intended for cases in which the client …
3
votes
2 answers

Why am I getting a HTTP 400 bad request response when sending a manually-crafted HTTP request over a TCP socket?

I'm trying to build an HTTP request manually (as a string) and send it over a TCP socket, this is what I'm trying to do: import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import…
Salah Eddine Taouririt
  • 24,925
  • 20
  • 60
  • 96
3
votes
1 answer

Youtube API v3 video.update response 400 - invalidRequest

the problem is fairly simple, I cannot make a very simple request to youtube api video.update without getting a 400 response with a reason 'invalidRequest'. I'am using Youtube API Explorer…
3
votes
1 answer

bad request error 400 while using python requests.post function

I'm trying to make a simple post request via the requests library of Python and I get a bad request error (400) while my url is supposedly correct since I can use it to perform a get. I'm very new in REST requests, I read many tutorials and…
3
votes
1 answer

HTTP POST Request, 400 bad request error

I am having a problem with HTTP requests. I keep getting a 400 error. The service I'm trying to access is expecting a JSON body with the following format: { "items":[{ "id":0, "modifiers":[], "note":"", …
user2324679
  • 31
  • 1
  • 1
  • 3
3
votes
1 answer

Spring. Error 400 during validation

Here is an issue I have been stuck into. Actually, I implemented all required features in order to get couple of my field validated, however I still get that 400 error. I even compared what I have made with examples from Spring 3 for Professionals…
orionix
  • 61
  • 1
  • 3
  • 10
3
votes
1 answer

Raven returning 400 "Request Too Long" error when NServiceBus tries to schedule a timeout

I have an NServiceBus saga that is trying to schedule a timeout using the Raven timeout persister but when it tries it gets this error: NServiceBus.Unicast.Transport.Transactional.TransactionalTransport [(null)] <(null)> - Failed raising 'transport…
Glenn Slaven
  • 33,720
  • 26
  • 113
  • 165
3
votes
1 answer

Content type for file part of the multipart/form-data request is set wrong by the client

I'm trying to send multipart/form-data with following JavaScript and jQuery: var formData = new FormData(); formData.append("projectName", $("#projectNameInput").val()); var file = $("#fileInput")[0].files[0]; formData.append("content",…
3
votes
1 answer

PUT request results in 400 Bad Request

I am trying to do a PUT request to a Web API method using HttpClient. An almost identical POST request works as expected, but the PUT request results in a 400 (Bad Request) error. I'm not sure what I'm doing wrong. Here is my web API controller…
2
votes
1 answer

WCF REST and IIS Express 7.5 returns Request Error (400)

I am struck with the following issue on hosting WCF Rest based services in IIS. Interface: [ServiceContract] public interface ITestService { [OperationContract] [WebInvoke(Method = "GET", UriTemplate = "/GetEmployee/{userid}", RequestFormat…
Naveen
  • 43
  • 8
2
votes
1 answer

webservice is throwing 400 Bad request when sending certain characters in post body?

I currently have a webservice running on a server somewhere, and if i access the webservice locally i can type in anything and it takes the inputs without any problem. However, when trying to make a http-post to the webservice from the outside with…
Jens Bergvall
  • 1,617
  • 2
  • 24
  • 54
2
votes
1 answer

Malformed HTTP Request in Apache

I have an Apache server which gets a malformed HTTP Request (cookie size is very big). The server displays the Cookie value along with Bad Request. Is there a way to handle this? I tried ErrorDocument directive, but that is not helping in this case.
thefourtheye
  • 233,700
  • 52
  • 457
  • 497
2
votes
1 answer

How to "throw" a Bad Request from a JSP

I have a very simple JSP file, which more or less displays a get variable.

Hello, <%= request.getParameter("name") %>

So, if I go to webpage.jsp?name=Alice, I'd get Hello, Alice. If I just go to webpage.jsp on the other hand, I get Hello,…
Svish
  • 152,914
  • 173
  • 462
  • 620
2
votes
1 answer

Http - error writing a body to connection: handshake not complete

i get a 400 bad request error "Your browser sent an invalid request." when i want to reach my website. Here is the error i get in the console : enter image description here My server code : import { Application} from…
Kogami997
  • 33
  • 5