2015-03-23 05:57 AM
Hi All,
I'm evaluating the SPWF01, so I want to send an Android GCM HTTP post (json or plain text) - but I've no success. I tried it with: AT+S.HTTPPOST=android.googleapis.com,/gcm/send,Content-Type:application/x-www-form-urlencoded;charset=UTF-8&Authorization:key=APIKEY,80 and also with: AT+S.HTTPPOST=android.googleapis.com,/gcm/send,Content-Type:application/json&Authorization:key=APIKEY,80 I got following answer: HTTP/1.0 401 Unauthorized Has anybody an idea or can give me an example how to send the http header via the SPWF AT command? Best regards, Flo #http-post #spwf #gcm2015-03-23 11:42 AM
Hi Flo,
Content-Type is statically and automatically added by AT-command itself.You need to write only address, path to cgi/php/other engine, and form content (in form ''name=value[&]''). Default port is 80.Example: at+s.httppost=posttestserver.com,/post.php,name=demo&email=mymail&subject=subj&body=messageCan I help you somehow?Ciaojerry2015-03-25 03:35 AM
Hi Jerry,
thank you for your answer. Poorly, I still don't get it. Do you have another example for me, for example a command with a header information for an Android GCM request: https://developer.android.com/google/gcm/http.html The request contains two parts: - HTTP Header --> Authorization & Content Format - HTTP Body --> Data If no content format is transmitted, plain text will be used instead of JSON. So I tried AT+S.HTTPPOST=android.googleapis.com,/gcm/send,name=Authorization:key=APIKEY,80 How can I tell the application, that the message of the body is in JSON format? That would be a nice example for the ''Wifi Training - Hands on'' ;) Also sending an email via smtp would be another very nice example for evaluation the module ;) Kind regards, Flo2015-03-25 07:26 AM
Hi Flow,
I got your point. Since surrent ''content type'' is statically added, and since you need a ''custom'' content type, standard HTTP command is not suitable for you.Maybe a '',content-type'' parameter is enough in standart HTTP command to set a ''custom'' content type. I mean, moving from ''address,path,form-content, port'' to ''address,path,form-content,port,content-type''.Is this what you are looking for?In the meanwhile, you could use basic sockets in place of high level HTTP commands:1 - open a socket2 - write request3 - wait for WIND:55 indicator4 - wait for WIND:58 indicator, if any5 - read web server replyIs this working?About SNMP, thanks for suggesion.Ciaojerry2015-04-02 01:29 PM
Hi Jerry,
thank you for your hint. Unfortunately, I still don't get it. I will wait for the release of the next firmware version unitl I spend more work in this. But if anyone has a solution, I will test it before ;) buona notte, Flo2015-04-03 06:05 AM
Hi Flow,
I'm not an expert on this kind on stuff, but I'm almost sure that, once socket is opened with server, you can do whatever you want.Be sure on target address (gcm.googleapis.com?
) and port (5235?
), and try to write proper http requests.Note that FW release will contain also TLS/SSL secure layer. HTTPS can also be used.ciaoj2015-10-06 12:13 AM
Hi all,
I have a same problem. How can I specify Content-Type in AT-commandAT+S.HTTPPOST
? I used:at+s.httppost=192.168.1.53,/events.aspx,application/x-www-form-urlencodedt=subj&body=message
Modul began to use -application/x-www-form-urlencoded
as Content-Type. And modul use thisapplication/x-www-form-urlencoded
as Content-Type after switch off. Could you help me, plz?2015-10-06 12:17 AM
Hi Sergey,
using current FW release, the only possibility is to open a socket and manage custom http request by SOCKW command.Next FW release will allow to solve this current limit. Stay tuned :)j2015-10-06 01:31 AM
Hi, Gallucci.
Thank you. I used last FW 3.4. When can I wait for new FW?2015-11-06 07:36 AM
Hello there!
@Flow: I'm kinda in the same boat as you were some month ago. Did you find any solution to your problem? I'm dying to hear it, 'cuz I'm kinda stuck, like you were.Regards.