Skip to main content
Silly-V
Legend
October 25, 2017
Question

HttpConnection not working on some URLs?

  • October 25, 2017
  • 0 replies
  • 308 views

Here's a question: I tried the below code on the 3 URLs which are inside the code, and it only works on the putsreq site. Is this true for others, and why?

#target bridge

function test(){

  if ( !ExternalObject.webaccesslib )

    ExternalObject.webaccesslib = new ExternalObject('lib:webaccesslib');

  var response = null;

  var responseHeaders = null;

    // var http = new HttpConnection('https://requestb.in/sfeof5sf') ; // not working

    // var http = new HttpConnection('https://jsonplaceholder.typicode.com/posts/1') ; // not working

    var http = new HttpConnection("http://putsreq.com/85Np9n50u2q2E48HBaiI"); // working

   

    http.timeout = 22;

    http.execute() ;

    response = http.response;

    $.write(response);

};

test();

This topic has been closed for replies.