Thursday 15 January 2015

HTTP headers for chunked encoding POST - Error 411 -


I am sending data to a server I do not know the required content-length one-priority, so I select "Selected" I am using encoding.

When I tried it with

  client.println ("POST / myurl HTTP / 1.1"); Client.println ("host: 12.345.679.999"); // changed with the test server's IP client. Println ("User-agent: Ardino / 1.0"); Client.println ("Transfer-Encoding: Selected"); Client.println (); Client.println ("4"); Client.println ("test"); Client.println ("0"); Client.println ();   

Or, with the escape characters:

  client.print ("4 \ r \ ntest \ r \ n0 \ r \ n \ r \ N ");   

I get an error from my server:

  HTTP / 1.1 411 length Required Requested method POST Requires a valid content-length Server: Apache / 2.2.22 (Ubuntu)   

However, the "selected" encoding should not require content-length header fields, see

Do I have a field ? Why does this call not work?

For records, non-encoded-encoding works:

  if (client.connect (server, 80)) {string postdata = "test"; Serial.printLN ("POST / MYURL HTTP / 1.1"); Client.println ("host: 12.345.679.999"); // was replaced with the test server's IP serial.printline ("User-agent: Ardino / 1.0"); Serial. Print ("Content-Length:"); Serial.println (PostData.length ()); Serial.println (); Serial.println (POSTDATA); }   

UPDATE

Apache 2 error. From log: "Barring the selected encoding encoding"

after searching

  forbidden chunk transfer encoding   

In my Apache 2 log, I concluded that That error was not what I was making in that post.

I have found that Modesse (Layer Between Apache and Diegogo) does not enable chunk transfer-encoding by default.

, I found that

  at WSGIChunkedRequest   

is allowed in my Apache httpd.conf file Overall request (no other 411 error)

No comments:

Post a Comment