HTTPS / OAuth Requests
Posted: Sun Dec 28, 2014 11:51 pm
Somewhat of a lurker here finally coming out to ask for help.
Thanks to this site I actually figured out how to get my second ESP up and running. (In my frustration I accidentally fried my first chip when I started to get careless. ) I've tried some searches both here and elsewhere, but still haven't found any answers. Hopefully one of you can help me out... here goes nothing:
How do I issue a GET request with authentication? I'm trying to query an API (specifically that belonging to [url]Wit.ai[/url]) but can't seem to get anything more than a 404 or misunderstood request response. At this point I'm literally after nothing more than the formatting of what I need to send to the ESP to make it work.
I can get the board connected to my WiFi network and then successfully connect to the server. But it's everything after
Update: So I seem to have figured out how to properly format my request such that the Wit server accepts it. But then I don't receive any data and the ESP unlinks immediately. Might that be because of something I'm doing? This is an example of the HTTP request I'm making (there are carriage returns and newlines between each line as per requirement):
Thanks to this site I actually figured out how to get my second ESP up and running. (In my frustration I accidentally fried my first chip when I started to get careless. ) I've tried some searches both here and elsewhere, but still haven't found any answers. Hopefully one of you can help me out... here goes nothing:
How do I issue a GET request with authentication? I'm trying to query an API (specifically that belonging to [url]Wit.ai[/url]) but can't seem to get anything more than a 404 or misunderstood request response. At this point I'm literally after nothing more than the formatting of what I need to send to the ESP to make it work.
I can get the board connected to my WiFi network and then successfully connect to the server. But it's everything after
Code: Select all
that doesn't seem to work for me. Call me a newbie, but I can't for the life of me figure out how to format my authenticated request and Google really isn't helping me today. AT+CIPSEND=n
Update: So I seem to have figured out how to properly format my request such that the Wit server accepts it. But then I don't receive any data and the ESP unlinks immediately. Might that be because of something I'm doing? This is an example of the HTTP request I'm making (there are carriage returns and newlines between each line as per requirement):
Code: Select all
AT+CIPSTART="TCP","54.193.84.116",443
AT+CIPSEND=178
>GET /message?v=20141228&q=how%20many%20lights%20are%20on HTTP/1.1
User-Agent: curl/7.37.1
Host: api.wit.ai
Accept: */*
Authorization: Bearer $My_Token_Here