-->
Page 1 of 1

HTTP Module return data

PostPosted: Thu Mar 17, 2016 1:20 am
by phando
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
Code: Select allContent-Type: application/json


Response handler.
Code: Select allfunction(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

Re: HTTP Module return data

PostPosted: Fri Mar 25, 2016 1:55 pm
by phando
I still don't have this working, but my data is now showing up as "<". I think with the proper application of the cjson module I might be able to get meaningful data from my http request. Have any of you successfully used the cjson module?