Set User-Agent to the client.
User-Agent on the client.
Set User-Agent to the client.
User-Agent string.
User-Agent on the client.
preset headers on the client.
host on the client.
preset query on the client.
preset request options on the client.
Decode a JWT token string to literal object payload.
token to decode.
some JWT decode options.
a literal object.
request with DELETE
method.
a promise with Response body
Creates (by Object.create) a new client instance with headers copy from the request.
IncomingMessage object that headers read from.
headers that will be copy into client.
a new client with with given headers.
request with GET
method.
a promise with Response body
request with PATCH
method.
a promise with Response body
request with POST
method.
a promise with Response body
request with PUT
method.
a promise with Response body
request with given method, url and data. It will genenrate a jwt token by signToken, and set to 'Authorization' header. It will merge headers, query and request options that preset into client.
method to request.
url to request, it will be resolved with client host.
data to request.
a promise with Response
Creates a periodical changed JWT token string with appId and appSecrets.
period in seccond, default to 3600s.
some JWT sign options.
a token string.
Creates a JWT token string with given payload and client's appSecrets.
Payload to sign, should be an literal object.
some JWT sign options.
a token string.
Decode and verify a JWT token string to literal object payload. if verify failure, it will throw a 401 error (creates by 'http-errors' module)
token to decode.
some JWT verify options.
a literal object.
Creates (by Object.create) a new client instance with given headers.
headers that will be copy into client.
a new client with with given headers.
Creates (by withHeaders) a new client instance with given X-Operator-ID
.
that will be added to header as X-Operator-ID
.
a new client with with given headers.
Creates (by Object.create) a new client instance with given request options.
request options that will be copy into client.
a new client with with given request options.
Creates (by Object.create) a new client instance with given query.
query that will be copy into client.
a new client with with given query.
Creates (by Object.create) a new client instance with given service methods.
service host for new client.
a new client with with given service methods.
Creates (by withHeaders) a new client instance with given X-Tenant-Id
and X-Tenant-Type
.
that will be added to header as X-Tenant-Id
.
that will be added to header as X-Tenant-Type
.
a new client with with given headers.
a retryable request, wrap of https://github.com/request/request. When the connection fails with one of ECONNRESET, ENOTFOUND, ESOCKETTIMEDOUT, ETIMEDOUT, ECONNREFUSED, EHOSTUNREACH, EPIPE, EAI_AGAIN, the request will automatically be re-attempted as these are often recoverable errors and will go away on retry.
request options.
a promise with Response.
Generated using TypeDoc
Client for teambition web service.