HTTP 1.1 POST Problem

Good morning guys,

I have a big problem. Hope someone can help me.

I have a HTTP connection to a testserver. I want to use HTTP1.1, but with HTTP 1.1 i can’t send data in DATA mode. Only with HTTP1.0 and a Content-length header i can post data to the server.

I found this topic in the forum … the talk about the same problem … (Topic is from 2009??? … Nothing changed?) [url]https://forum.sierrawireless.com/t/http-and-post-problems/3419/1]

Does anyone have the same problem and has found a workaround?

ati9
"DWL","V10c05","","Sierra Wireless",62640,"051513 10:45","a0836b50","00010000"
"FW","FW_752_34_3.SL6087G","R7.52.0.201306260837.SL6087","Sierra Wireless",673436,"062613 08:37","89796368","001d0000"
"MODEM","1.3.36","201306260837.SL6087","Sierra Wireless",1713240,"062613 08:37","85a2fb97","00020000"
"OAT","v1.3.1.20131223105602","Extended AT Application","Sierra Wireless",1526748,"122313 10:56","fdff3cc2","002a0000"
 -"Developer Studio","2.3.2.201310241753"
 -"Open AT OS Package","6.52.0.201311140649"
 -"Firmware Package","7.52.0.201312200625"
 -"Internet Library Package","5.56.0.201305170830"
 -"Location Library Package","2.0.0.201310171016"
 -"Security Library Package","2.2.0.201306261000"
 -"eCall Library Package","1.2.3.201306191228"
 -"Jamming Library Package","1.1.0.201312230837"
 -"ExtendedATApplication Library Package","1.3.1.201312231055"
"ROM","800000"
"RAM","200000"
"DWLNAME","SL6087"

Why not :question:

What, exactly, are you trying?
What results are you expecting?
What results are you actually getting - ADL error codes? HTTP error responses?

and did you not see the recent ones - right at the top of the topic listing for this forum:

First I only use AT Commands for HTTP Post

HTTP 1.0:
→ AT+WIPOPT=5,1,2,52,0
HTTP Post AT Command:
→ AT+WIPFILE=5,1,4,“http://posttestserver.com/post.php",“”,“”,“Accept”,“*/*”,“Accept-Encoding”,“deflate”,“Content-Type”,“application/json”,“Content-Length”,"9

With this command I can write “It work’s!” in DATA mode an the server get’s the data.

With HTTP1.1 I can write what i want in DATA mode and send an [EXT] at the end and the server get’s nothing…

But I don’t get an error or something!! HTTP Post is possible with both, but no data with HTTP 1.1

This is the same situation I faced (using AT commands to interface with the SL8080T on a SiWi Development board). I had tried everything I could imagine to to POST with the default (HTTP1.1).

I tried changing WIPOPT to HTTP1.0 and now POST requests now work properly to actually post JSON data.
I would like to be able to use HTTP1.1 though…

Hiya,

From the example you quoted, there are a couple of issues that I can see:

  1. Content-length=9 is probably wrong - you need to count the CRLF on the end of the line of data that you are sending
  2. when sending POST data, you usually need to set the content-type header to application/x-www-form-urlencoded for PHP to parse the post variables correctly
    3.As with (2), you usually need to urlencode your data to escape any specific control characters (ampersand ‘&’, plus ‘+’ and space ’ ’ are three that come to mind immediately. Often you need to encode quotes as well).

and finally … HTTP 1.1 REQUIRES that you have a HOST header or the HTTP server will bounce/drop/ignore the request.

I strongly recommend that you read HTTP made really easy to understand what’s happening in a HTTP transaction.

ciao, Dave