Package zebkit.io

The module provides number of classes to help to communicate with remote services and servers by HTTP, JSON-RPC, XML-RPC protocols.

  // shortcut method to perform HTTP GET request
  zebkit.io.GET("http://test.com").then(function(req) {
      // handle request
      req.responseText
      ...
  }).catch(function(exception) {
      // handle error
  });


public <String> b64decode (input)

Decode the base64 encoded string


Parameters:
  • input <String>

    base64 encoded string


Returns: <String>

a string

public void b64encode (input)

Encode the given string into base64


Parameters:
  • input <String>

    a string to be encoded

public <zebkit.DoIt> GET (url, [parameters])

Shortcut method to perform HTTP GET requests.

   zebkit.io.GET("http://test.com").then(function(request) {
       // handle result ...
   }).catch(function(e) {
       // handle error ...
   });

   var res = zebkit.io.GET("http://test.com", {
       param1 : "var1",
       param1 : "var2",
       param1 : "var3"
   }).then(function(req) {
       // handle result ...
   });

Parameters:
Returns: <zebkit.DoIt>

an object to handle result

public <zebkit.DoIt> POST (url, [data])

Shortcut method to perform HTTP POST requests.

   zebkit.io.POST("http://test.com", null).then(function(request) {
       // handle result
       ...
   }).catch(function(e) {
       // handle error ...
   });

   var res = zebkit.io.POST("http://test.com", {
       param1 : "var1",
       param1 : "var2",
       param1 : "var3"
   }).then(function(request) {
       // handle result
       ...
   });

   zebkit.io.POST("http://test.com", "request").then(function(request) {
       // handle error
       ...
   });

Parameters:
  • url <String>

    an URL

  • [data] <Object>

    a data or form data parameters


Returns: <zebkit.DoIt>

an object to handle result

public <String> UID ([size])

Generate UUID of the given length


Parameters:
  • [size] <Integer>

    the generated UUID length. The default size is 16 characters.


Returns: <String>

an UUID