Nikhil Dominic
Nikhil Dominic

Reputation: 23

Calling a REST API from JScript?

I am working on a platform which only supports JScript. And I am very virgin to JScript. Now I need to call a REST API from JScript to get a value.

URI : https://example.com:1234/getToken/cs?action=CE&data=1234567890124

This will return a JSON or Text (Can specify with an additional parameter with the URL)

Request Type: GET No authentication required.

Any help?

Upvotes: 0

Views: 200

Answers (1)

anasse hanafi
anasse hanafi

Reputation: 83

You can try this using jQuery library :

$.ajax({
   url: "https://example.com:1234/getToken/cs?action=CE&data=1234567890124",
   type: "GET"
   success: function(response){
     console.log(response);
   }
});

Upvotes: 1

Related Questions