Chat freely about anything...

User avatar
By rant
#8435 I have some post request in which i would like to send with the module, and get a JSON respond .
The request DOES works with any pc browser, but on the module i get "wrong syntax" when sent .

The request(which you can check on any browser) is this :
Code: Select allhttps://y4eI4XmKNT5D6MVtC565xkEjBAkggTlTMt1erNKv:javascript-key=NOkyJ0XBB4gdANXSCGE0slnH0QKXhZ5OPf7ma4Gk@api.parse.com/1/classes/DATA/TXcgRDCCRR


than the GET request is this :

Code: Select all    cmd="GET / HTTP/1.0\r\n HOST: https://y4eI4XmKNT5D6MVtC565xkEjBAkggTlTMt1erNKv:javascript-key=NOkyJ0XBB4gdANXSCGE0slnH0QKXhZ5OPf7ma4Gk@api.parse.com/1/classes/DATA/TXcgRDCCRR\r\n\r\n";


which looks like this :
Code: Select allAT+CIPSTART=4,"TCP","api.parse.com",443
AT+CIPSEND=4,171
GET / HTTP/1.0
 HOST: https://y4eI4XmKNT5D6MVtC565xkEjBAkggTlTMt1erNKv:javascript-key=NOkyJ0XBB4gdANXSCGE0slnH0QKXhZ5OPf7ma4Gk@api.parse.com/1/classes/DATA/TXcgRDCCRR



I have tried many configurations(with/without the HTTP etc), so please advice me on something you can check and get a JSON respond .

Thanks a lot !
User avatar
By Sprite_tm
#8438 Ah, there's so much wrong there...

First of all, you can't just connect to a https service by just modifying the port to 443. You need to set up a SSL connection. Unfortunately, I have no idea if the AT firmware can do that.
Secondly, your URL consists of 3 parts, which a browser will happily split and handle separately before it gets sent over the line:

y4eI4XmKNT5D6MVtC565xkEjBAkggTlTMt1erNKv:javascript-key=NOkyJ0XBB4gdANXSCGE0slnH0QKXhZ5OPf7ma4Gk
These are actually an username and password separated by a colon

api.parse.com
This is the hostname

/1/classes/DATA/TXcgRDCCRR
This is the path.

Handling the username/password bit actually is somewhat complicated, but without it, your GET request should look like this:
GET /1/classes/DATA/TXcgRDCCRR HTTP/1.0
Host: api.parse.com
You will need to look up how to do authentication yourself. Hint:L Google for 'http basic authentication'
User avatar
By rant
#8439 Thanks a lot .

First of all , i actually can connect to the server using the port 443 , the connection is ok .
Second, i guess i will need http basic authentication , but the main goal here is to send push notification to a user's iPhone ,
I chose Parse server API , but i guess that any other service that do that(pushes), will require authentication , isn't it ?

So , how do you suggest us to send pushes in a simple way using the module ? ( Thingspeak ? IFTTT ? )

Thanks .