-
• #2
Hey!
It appears the host parameter might be the problem, try stripping the http:// from there:
host: "http://www.upwork.com",
(oops perhaps that is just this forum problem that it tries to convert all hostnames to a link? In the edit field of this post there is no "http://" in the host field value)
-
• #3
thanks for your interest. I've tried without http. this didn't help
-
• #4
And now try with a colon in the protocol. Like
protocol:"https:"
. I have tried this in the Linux Espruino build and it worked for me. -
• #5
Thanks. Just tried. Got response:
<html> <head><title>400 The plain HTTP request was sent to HTTPS port</title></head> <body bgcolor= <html> <head><title>400 The plain HTTP request was sent to HTTPS port</title></head> <body bgcolor="white"> <center><h1>400 Bad Request</h1></center> <center>The plain HTTP request was sent to HTTPS port</center> <hr><center>cloudflare-nginx</center> </body> </html>
Did you get xml in response?
-
• #6
With options like
var options = { method: 'GET', host: "http://www.upwork.com", path: "/ab/feed/jobs/rss", protocol:"https" };
I'm not setting port. And host also without "http" part. Response look follow:
httpCRs { "headers": { "Date": "Tue, 26 Dec 2017 14:45:42 GMT", "Transfer-Encoding": "chunked", "Connection": "close", "Cache-Control": "max-age=3600", "Expires": "Tue, 26 Dec 2017 15:45:42 GMT", "Location": "https://www.upwork.com/ab/feed/jobs/rss", "X-Content-Type-Options": "nosniff", "Server": "cloudflare-nginx", "CF-RAY": "3d34d34e07fe6409-FRA" }, "httpVersion": "1.1", "statusCode": "301", "statusMessage": "Moved Permanently" } 0 CLOSE
-
• #7
The issue seems to be that the protocol you're using needs HTTPS, but it isn't supported in Espruino for ESP8266. Instead, you'd need an Espruino WiFi or ESP32.
-
• #8
Got it. Thanks
Hello!
I'm trying to parse xml from url. My code looks like:
And I got response:
Seems espruino tries to get host by it's IP, but as I know target site is not accessible by it's IP. Typing url
in browser's address line will return rss feed
So my question is there any workaround for that?
Would appreciate any help