Problems with response after GET request #5671
Replies: 1 comment
-
|
Posted at 2017-07-20 by @gfwilliams What happens if you try that same code from Node.js on the desktop? You could try setting 'User Agent' in the headers? It's possible that Etsy blocks anything that it isn't sure is a web browser Posted at 2017-07-20 by Hansi Hi, thanks for the answer I've tried in such a way: For this request, I got a response from Apache server 200 and see 'content-type': 'application/json', but don't know how to read it(it's the next step). But with 'http' I receive the response as before even with using Agent in request Posted at 2017-07-21 by Hansi Finally it works in node.js but it is Https - there is no support of Https? Posted at 2017-07-21 by dave_irvine Not on ESP8266. Not enough RAM for HTTPS. Posted at 2017-07-21 by Hansi Eh, it's a pitty) I found this on site: To specify keys and certificates, you can use an options object - see require('tls').connect(...) So if I will use Pico or WIFI it should work? Posted at 2017-07-21 by @MaBecker Hi Hansi, check MrTimcakes http2https Posted at 2017-07-21 by Hansi
Now it works in my desktop node.js but when I try the same in ESP8266 I receive But now it's closer to the solution!) UPD Posted at 2017-07-22 by @MaBecker Hmm, this is how far I get with your code and without a key Posted at 2017-07-22 by Hansi Have you checked via desktop node.js or your microcontroller? Oh, finally I've found my mistake, current result: Now I can receive what I want. Just don't know why it always shows such messages: In node.js is just: Posted at 2017-07-24 by @gfwilliams It's because you're parsing the data into JSON as it arrives. In Node.js it's arriving in one big chunk but in Espruino it's a few smaller ones. Do like it suggests here and do stuff on the Posted at 2017-07-24 by Hansi oh, thanks, Gordon, good support on your forum. Posted at 2017-08-13 by Hansi Could anyone explain this message in console: Is it mean that I run out the memory? Posted at 2017-08-13 by @MaBecker you can find reset causes explained in this document The most root cause is running out of heap. Use this statement to get debug info on console like heap size Posted at 2017-08-15 by Hansi Could you please explain what 'heap' in the output means? Problem is that after starting of program everything is ok, I make 3 requests at the same time every 180seconds. But on 10th time it shows error - out of memory, and every time it happens on different try. Probably I should clean ram somehow after each request or something like this? (using of non-custom font helps a little bit, but errors still happen). Thank you for answers! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2017-07-20 by Hansi
Hello,
I'm trying to create a counter for Etsy platform which has its own API. I have already tried it via console ( with XMLHttpRequest()) and everything works fine. And have started working with ESP8266.
Wifi connected, the request is sent, but I receive not the same answer as for example when putting the same URL in the browser.
My function:
in console I see:
But if I put the same request in browser "https://openapi.etsy.com/v2/shops" I at least see "API request missing api_key or valid OAuth parameters" (just don't want to show my ApiKey).
As for other links "http://www.pur3.co.uk/hello.txt" or "http://samples.openweathermap.org/data/2.5/weather?q=London,uk&appid=b1b15e88fa797225412429c1c50c122a1" everything is ok.
So in result I'm see 'the wall' before next steps.
Could anyone help to solve it?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions