HTTP POST error when using SIM900

hi,
im using an arduino to post to a thingspeak.com/ channel using a SIM900 GSM modem. i cannot use the library since i am using a general SIM900 module. i used the following commands.

AT+SAPBR=3,1,“Contype”,“GPRS”
OK
AT+SAPBR=3,1,“APN”,“WWW”
OK
AT+SAPBR=1,1
OK
AT+SAPBR=2,1
+SAPBR: 1,1,“100.119.182.199”

OK
AT+HTTPINIT
OK
AT+HTTPPARA=“CID”,1
OK
AT+HTTPPARA=“URL”,“http://api.thingspeak.com/update
OK
AT+HTTPDATA=188,10000
DOWNLOAD

ERROR
AT+HTTPACTION=1
OK

+HTTPACTION:1,400,1 //400 means bad HTTP request

i have no idea why i am getting an error after i transfer the POST request data within 10 seconds after the AT+HTTPDATA command.

The POST request looks something like this. This is sent after the DOWNLOAD response from the modem.
POST /update HTTP/1.1
Host: api.thingspeak.com
Connection: close
X-THINGSPEAKAPIKEY: i use the write key for my channel here
Content-Type: application/x-www-form-urlencoded
Content-Length: 14

field1=150

Can someone please help? TIA

i found out the problem. when posting to the website you do not need to send the complete POST format to the GSM modem. Just the data

So after AT+HTTPDATA=,
DOWNLOAD
send just key=your write API key&field1=data_you_want_to upload

it works

you dont have to send
POST /update HTTP/1.1
Host: api.thingspeak.com
Connection: close
X-THINGSPEAKAPIKEY: i use the write key for my channel here
Content-Type: application/x-www-form-urlencoded
Content-Length: 14

field1=150

Hi Veeru, I don't understood very clear, when I finish AT+HTTPDATA=188,10000 And appear DOWNLOAD, just send My_API_KEY&field1=30, then, not thing happen. Do you have any idea?

I think that he want to say:

key=XXXXXXXXXXXXXXXX&field1=x

Hi, is this working for anyone? I don't understand how you send "key=XXXXXXXXXXXXXXXX&field1=x". I can't send it just like that. What is the correct AT command?

Are you guys still having problems with this? I've finally got it working on my setup and made a post about it on my blog.

http://georgestone72.blogspot.com/2016/08/posting-to-thingspeak-over-gprs-with.html

scolin912:
Hi Veeru,
I don’t understood very clear, when I finish AT+HTTPDATA=188,10000
And appear DOWNLOAD, just send My_API_KEY&field1=30, then, not thing happen.
Do you have any idea?

that coz your modem is waiting for 188 bytes. the command for HTTPDATA must be like this
AT+HTTPDATA=<number_of_bytes>,timeout value