Zebra API Doc

zebra.io.GET()

GET

(
  • url
  • [parameters]
  • [callback]
)

Shortcut method to perform asynchronous or synchronous HTTP GET requests.

   // synchronous HTTP GET call
   var res = zebra.io.GET("http://test.com");

   // asynchronous HTTP GET call
   zebra.io.GET("http://test.com", function(request) {
       // handle result
       if (request.status == 200) {
           request.responseText
       }
       else {
           // handle error
       }
       ...
   });

   // synchronous HTTP GET call with query parameters
   var res = zebra.io.GET("http://test.com", {
       param1 : "var1",
       param1 : "var2",
       param1 : "var3"
   });

Parameters:

  • url String

    an URL

  • [parameters] Object optional

    a dictionary of query parameters

  • [callback] Funcion optional

    a callback function that is called when the GET request is completed. Pass it to perform request asynchronously