Response from ImSmart.http

41 views
Skip to first unread message

chadgw...@gmail.com

unread,
May 23, 2020, 12:48:18 PM5/23/20
to ImSmart.tech
I can't figure out how to get the response from the ImSmart.http call. 

For example:
var response = ImSmart.http('http://api.sunrise-sunset.org/json?lat=40.712776&lng=-74.005974&formatted=1',false);

response will always be undefined.

I also tried the long form:
var response = new ImSmart.http();
response.method = 'GET';
response.async = false;
response.send();

However, response.responseText, for example is undefined. 

Can you please let me know.

Thank you,
Chad

ImSmart.tech

unread,
May 25, 2020, 8:26:37 AM5/25/20
to ImSmart.tech
I'm checking.

Paul
ImSmart

ImSmart.tech

unread,
May 25, 2020, 9:51:18 AM5/25/20
to ImSmart.tech
The issue is fixed.
You should get the response now.

Paul
ImSmart

chadgw...@gmail.com

unread,
May 26, 2020, 12:15:43 AM5/26/20
to ImSmart.tech
Thank you! I confirmed that it is working for me. 
Curious, how do I get the response in the long form?
For example:

ImSmart.tech

unread,
May 26, 2020, 8:10:17 AM5/26/20
to ImSmart.tech
var request = new ImSmart.http();
request.method = 'GET';
request.async = false;
var response = request.send();
ImSmart.log(response);


Paul
ImSmart

chadgw...@gmail.com

unread,
May 26, 2020, 10:05:32 AM5/26/20
to ImSmart.tech
Ah. I need to set a response = request.send(). Thank you!
Reply all
Reply to author
Forward
0 new messages