ScriptCraft

ScriptCraft

14.6k Downloads

How i can send http request?

TheRadioGuy opened this issue ยท 3 comments

commented
commented

@DuckerMan the API documentation includes a section on the built in http module and includes a useful example:

var jsResponse;
var http = require('http');
http.request('http://scriptcraftjs.org/sample.json',function(responseCode, responseBody){
  jsResponse = JSON.parse( responseBody );
});

Hope this helped!

commented

It's not synchronous, that's why the callback is required.

commented

Thanks!
Is this asynchronous in bukkit?