Good evening, I have a problem with NodeMCU programmed in Lua. I should get a https get request but I can't. I tried with the net module but it gives me the error of redirection 301. Using http.get instead it gives me an error - 114. How can I solve my problem? Is there a way to make https requests in Lua? My firmware is 2.2.1 custom with SSL true
Asked
Active
Viewed 611 times
-1
-
3Please read [ask]. Add a [mcve]. – Piglet Mar 25 '19 at 22:59
-
Yes we are using [Lua-cURL](https://github.com/Lua-cURL/Lua-cURLv3). – csaar Mar 26 '19 at 14:08
-
@csaar I guess that lua-curl will not work on nodeMCU. – val - disappointed in SE Mar 26 '19 at 15:33
-
How can I install this Lua-cURL on nodeMCU? – Gio Mar 26 '19 at 16:57
-
You know, maybe you should first of all ask why your HTTP request doesn't work. That seems like your real problem right now, not installing some extra HTTP library that just takes up unnecessary space. – DarkWiiPlayer Mar 27 '19 at 13:47
1 Answers
1
301
is not an error; It's a normal HTTP Status code that signals to a HTTP Client that the resource that it expected is no longer available at the given URL.
If I remember correctly, the new URI of the resource should be available in the HTTP Header Location
. Most HTTP Libraries take care of these redirections for you, but it's possible that NodeMCU, aiming to be as small and simple as possible, doesn't do this.
Just look for that header when you get a 301
response and start a new request to that URI with the same callback.

DarkWiiPlayer
- 6,871
- 3
- 23
- 38