2

When I send the following http post request:

POST /query.fcgi HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Content-Length: 63

form_state=3&form_name=system_sw_upgrade&field_name=http_upload

The server responds with a BAD Request

What's wrong with the request?

user357498
  • 139
  • 3
  • 5
  • It seems it is missing controller (or) request processor in the URL, last line your post seesm only parameters. Here is link on causes and solutions. http://www.getnetgoing.com/HTTP-400.html – kosa Jan 11 '12 at 18:35

1 Answers1

2

Your request is missing a Host header. From the spec (see 14.23):

A client MUST include a Host header field in all HTTP/1.1 request messages . If the requested URI does not include an Internet host name for the service being requested, then the Host header field MUST be given with an empty value. An HTTP/1.1 proxy MUST ensure that any request message it forwards does contain an appropriate Host header field that identifies the service being requested by the proxy. All Internet-based HTTP/1.1 servers MUST respond with a 400 (Bad Request) status code to any HTTP/1.1 request message which lacks a Host header field.

toddsundsted
  • 6,225
  • 2
  • 21
  • 13