Class: OAuth2Response

vertx-auth-oauth2-js/o_auth2_response~ OAuth2Response

new OAuth2Response()

A response from a fetch request. This class represents a secure response from a Oauth2 fetch call. A fetch is a simplified HTTP response from a protected resource.
Source:

Methods

body() → {Buffer}

The HTTP response body as a buffer
Source:
Returns:
a buffer with the HTTP response body
Type
Buffer

getHeader(name) → {string}

Looks up a HTTP response header by name, in case where the response is a list of headers, the first one is returned.
Parameters:
Name Type Description
name string of the header to look up
Source:
Returns:
the single value for the header.
Type
string

headers() → {MultiMap}

The HTTP response headers from the HTTP layer.
Source:
Returns:
the HTTP headers
Type
MultiMap

is(contentType) → {boolean}

Helper to analize the response body. The test is performed against the header Content-Type, the content of the body is not analyzed.
Parameters:
Name Type Description
contentType string a content type to test, e.g.: application/json
Source:
Returns:
true if the header matches
Type
boolean

jsonArray() → {todo}

The HTTP response body as a JsonArray
Source:
Returns:
a JsonArray from the HTTP response body
Type
todo

jsonObject() → {Object}

The HTTP response body as a JsonObject
Source:
Returns:
a JsonObject from the HTTP response body
Type
Object

statusCode() → {number}

the returned status code from the HTTP layer.
Source:
Returns:
HTTP status code
Type
number