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.

no subtypes hierarchy

Initializer
OAuth2Response(OAuth2Response unknown)
Inherited Attributes
Attributes inherited from: Object
hash, string
Methods
bodyshared default Buffer? body()

The HTTP response body as a buffer

getHeadershared default String getHeader(String name)

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

    of the header to look up

headersshared default MultiMap? headers()

The HTTP response headers from the HTTP layer.

isshared default Boolean is(String contentType)

Helper to analize the response body. The test is performed against the header Content-Type, the content of the body is not analyzed.

Parameters:
  • contentType

    a content type to test, e.g.: application/json

jsonArrayshared default Array? jsonArray()

The HTTP response body as a JsonArray

jsonObjectshared default Object? jsonObject()

The HTTP response body as a JsonObject

statusCodeshared default Integer statusCode()

the returned status code from the HTTP layer.

Inherited Methods
Methods inherited from: Object
equals