Class: JWebClient

JWebClient~JWebClient

JWebClient

Constructor

new JWebClient()

Implementation of HTTPS-based JSON-Web-Client
Source:

Members

key_pair :Object

User account key pair
Type:
  • Object
Source:

last_nonce :string

Cached nonce returned with last request
Type:
  • string
Source:

verbose :boolean

Determines verbose mode
Type:
  • boolean
Source:

Methods

createJWT(nonce, payload, alg, key, jwk) → {string}

create JSON-Web-Token signed object
Parameters:
Name Type Description
nonce string | undefined
payload Object | string | number | boolean
alg string
key Object | string
jwk Object
Source:
Returns:
Type
string

emptyCallback()

Helper: Empty callback
Source:

evaluateStatus(uri, payload, ans, res)

check if status is expected and log errors
Parameters:
Name Type Description
uri string
payload Object | string | number | boolean
ans Object | string
res Object
Source:

get(uri, callback, errorCallback)

make GET request
Parameters:
Name Type Description
uri string
callback function
errorCallback function
Source:

post(uri, payload, callback, errorCallback)

make POST request
Parameters:
Name Type Description
uri string
payload Object | string | number | boolean
callback function
errorCallback function
Source:

request(query, payload, callback, errorCallback)

make GET or POST request over HTTPS and use JOSE as payload type
Parameters:
Name Type Description
query string
payload string
callback function
errorCallback function
Source: