boblemaire / asyncHTTPrequest

asynchronous HTTP for ESP using ESPasyncTCP. Works like XMLHTTPrequest in JS.
GNU General Public License v3.0
64 stars 31 forks source link

Is JSON supported as response? #17

Closed diego-feder closed 4 years ago

diego-feder commented 4 years ago

I'm trying to GET response from a firebase cloud functions and at the moment I'm using JSON in my entire application (https://us-central1-culltive.cloudfunctions.net/api/devices).

I just copied your sample app and modified the html to the one listed above but had no success.

This is what I get on debug: Debug(4930): setDebug(on) version 1.1.15 Debug(14931): open(GET, https://us-central1-culltive.clo) Debug( 1): send() Debug( 1): _buildRequest()

Exception (28): epc1=0x4000bf80 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

boblemaire commented 4 years ago

The content type of the response is not significant at this level. First thing you can do is get the latest version 1.2.1. This looks like an ESP8266, so that's probably not the issue, but it takes some of the guesswork out. Next, you should run the exception decoder on the stacktrace and see if the exception is happening in asyncHTTPrequest or someplace else. Lastly, asyncHTTPrequest does not support HTTPS, so open would have returned false. Probably need to bulletproof against code that proceeds to send data even if open fails.

diego-feder commented 4 years ago

Thank you for the in depth response. I'm a little bit new to this so I'm catching up. I ended up using another lib and managed to make it work. Thanks again ;)