HTTP Object: Difference between revisions

From Data Islands
(Created page with "The HTTP object is used to make HTTP requests to variosu web api's. Examples: Consuming a weather api<blockquote>jint di var req = HTTP(); req.Url="<nowiki>https://api.open-meteo.com/v1/forecast?latitude=52.52&longitude=13.405&hourly=temperature_2m</nowiki>"; req.Method="GET"; var response = req.Send(); var json = response.JSON; //REM show the full response di.display(response.body); //REM show part of the respone di.display(json.latitude);</blockquote>")
 
No edit summary
Line 19: Line 19:


di.display(response.body);
di.display(response.body);
//REM show the object
di.display(json.toString());


//REM show part of the respone
//REM show part of the respone


di.display(json.latitude);</blockquote>
di.display(json.latitude);
 
 
</blockquote>

Revision as of 08:31, 26 May 2025

The HTTP object is used to make HTTP requests to variosu web api's.


Examples:

Consuming a weather api

jint di

var req = HTTP();

req.Url="https://api.open-meteo.com/v1/forecast?latitude=52.52&longitude=13.405&hourly=temperature_2m";

req.Method="GET";

var response = req.Send();

var json = response.JSON;

//REM show the full response

di.display(response.body);

//REM show the object

di.display(json.toString());

//REM show part of the respone

di.display(json.latitude);