HTTP Module return data
Posted: Thu Mar 17, 2016 1:20 am
Hey All,
Things are starting to work! I just went to nodemcu-build.com and made a custom firmware. Among other things, my firmware was a dev build with http and ssl support. I have been able to hit my ssl endpoint and am expecting a response with a code of 200 and a value of 1.
My response is expecting JSON
Response handler.
The response is coming back with the proper status code of 200. The data seems to be coming back as the wrong type. I get a funky little gibberish character with a question mark in it. When I try to send content-type of text/plain, the return status is 415.
Can you please help me turn the gibberish character into a meaningful value?
Thanks
Things are starting to work! I just went to nodemcu-build.com and made a custom firmware. Among other things, my firmware was a dev build with http and ssl support. I have been able to hit my ssl endpoint and am expecting a response with a code of 200 and a value of 1.
My response is expecting JSON
Code: Select all
Content-Type: application/json
Response handler.
Code: Select all
function(code, data)
if (code < 0) then
print("HTTP request failed")
else
print(code, data)
end
The response is coming back with the proper status code of 200. The data seems to be coming back as the wrong type. I get a funky little gibberish character with a question mark in it. When I try to send content-type of text/plain, the return status is 415.
Can you please help me turn the gibberish character into a meaningful value?
Thanks