HL7802 : HTTP PUT problem

Hello,

I have problem in order to do HTTP PUT requests with HL7802 module.
Here is how I do :

AT&K3
AT+KCNXCFG=1,“GPRS”,“swisscom-test.m2m.ch”
AT+KCNXTIMER=1,60,2,70
AT+KCNXPROFILE=1
AT+CGATT=1
AT+KHTTPCFG=1,“superaddress.com”,80,0
AT+KHTTPHEADER=1 ← I write header content below
AT+KHTTPPOST=1,"/HiveTracker/index3.php" ← I write body content below
AT+KHTTPCLOSE=1
AT+KHTTPDEL=1

Header content :
Content-Length: 22
Content-Type: application/x-www-form-urlencoded
–EOF–Pattern–

*Body content : *
firstname=a&lastname=b

I don’t know why but the body content seems not to be sent ?
Here is what I receive on the server side :

New Client: 212.243.142.179
POST /HiveTracker/index3.php HTTP/1.1
host: 91.201.149.7
Authorization: Basic Og==
Content-Length: 22
Content-Type: application/x-www-form-urlencoded

As you can see, there is nothing about the data (firstname=a&lastname=b)

When I use this command : AT+KHTTPPOST=1,"/HiveTracker/index3.php"
And I write something after CONNECT, the request is directly sent…
With an Apache server, I get a bad request error.

Can someone helps me ?

Thank you for your help,
David


Update : 14h35
If I only set Content-Length: 22 on the header, I am able to write something after the CONNECT of AT+KHTTPPOST=1,"/HiveTracker/index3.php"

Hovewer, I must set the Content-Type !!

Thank you,
Waiting on your help,
David


Update : 16h00

Seems to work with Tera Term.
I don’t know why but it does not work with Putty.
I expect a problem with new lines…

Copy
Content-Length: 22
Content-Type: application/x-www-form-urlencoded
–EOF–Pattern–
into Notepad++
Replace all \r\n by \n
In Tera Term, when setting the header (after CONNECT), copy the content from Notepad++ and past it to Tera Term. Then manually do new lines.

If someone has explaination or can explain to me how to fix it in Putty ?

Thank you for your help,
David

Hi David,
When you use Teraterm, \r\n(0x0D 0x0A) will be added for a new line.
While when use Putty, \r(0x0D) will be added for a new line.
The AT+KHTTPHEADER=1 can work fine only with the \r\n(0x0D 0x0A).
E.g.
AT+KHTTPHEADER?
+KHTTPHEADER: 1,3 //when you use Teraterm, it will be 3. Then it works fine.
Content-Length: 22
Content-Type: application/x-www-form-urlencoded

OK

Hello,

So, I configured Tera Term (Setup, Terminal, Transmit : CR+LF) in order to send CR+LF for each new line.

All works fine now.

Thank you,
David