Is it possible to send POST data with a HEAD Request?
2 Answers
No, a HEAD request is different from a POST request. A HEAD request does not accept post data. From the HTTP specification section 9.4:
The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. The metainformation contained in the HTTP headers in response to a HEAD request SHOULD be identical to the information sent in response to a GET request. This method can be used for obtaining metainformation about the entity implied by the request without transferring the entity-body itself. This method is often used for testing hypertext links for validity, accessibility, and recent modification.
Since a GET request does not contain post data, a HEAD request also does not.

- 951,095
- 183
- 1,149
- 1,285
-
2I did not find, where it was forbidden to send a request body (a.k.a. POST data) in the GET request. It is not specified, but is not explicitly forbidden. – 30thh Nov 16 '11 at 10:06
-
@30thh: see [section 4.3](http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.3), "A message-body MUST NOT be included in a request if the specification of the request method (section 5.1.1) does not allow sending an entity-body in requests." You will find that a GET request does not allow an entity-body. – Greg Hewgill Nov 16 '11 at 10:14
-
Is there a different method that is identical to POST except that the server MUST NOT return a message-body in the response? Like for example GET becomes HEAD and POST becomes HOST. But a HOST method doesn't exist. Maybe the most suitable method is PUT. But the metainformation contained in the HTTP headers in response to a PUT request aren't identical to the information sent in response to a POST request. Additionally PUT requests are handled way differently by web servers. – Robert Jul 23 '13 at 04:59
Using Arduino is frequently used this way to send data:
ArduinoClient.print("HEAD /wsendtemp.php?c1=");
ArduinoClient.print(temp[0]);
ArduinoClient.print("&time=");
ArduinoClient.print(micros());
ArduinoClient.println(" HTTP/1.1"); // attenzione allo spazio
//ArduinoClient.println("Host: 127.0.0.1");
ArduinoClient.println("Host: www.mcmajan.com");//184,173,194,61
ArduinoClient.println("User-Agent:Arduino");
ArduinoClient.println("Accept: text/html");
ArduinoClient.println("Connection: close");
ArduinoClient.println();
ArduinoClient.stop();