Class: RequestResult

RequestResult


new RequestResult(method, path, query, requestRaw, requestContent, responseRaw, responseContent, statusCode, responseHeaders, startTime, endTime)

A structure containing the request and response context for a given FaunaDB request. Provided to an observer function optionally defined in the Client constructor.

Parameters:
Name Type Description
method 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'

The HTTP method used in the request.

path string

The path that was queried. Relative to the client's domain.

query string

URL query parameters. Only set if method is "GET".

requestRaw Object

The JSON request string.

requestContent Object

The request data.

responseRaw string

The unparsed response data, as a string.

responseContent object | FaunaHttpErrorResponseContent

The response data parsed as JSON.

statusCode number

The HTTP response status code.

responseHeaders object

The HTTP headers returned in the response.

startTime number

The time the request was issued by the client.

endTime number

The time the response was received by the client.

Members


endTime :number

Type:
  • number

method :'GET'|'POST'|'PUT'|'PATCH'|'DELETE'

Type:
  • 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'

path :string

Type:
  • string

query :object

URL query. Null unless method == 'get'. Not related to Client.query.

Type:
  • object

requestContent :object

Type:
  • object

requestRaw :string

Type:
  • string

responseContent :object|FaunaHttpErrorResponseContent

Parsed value returned by the server. Includes "resource" wrapper dict, or may be an FaunaHttpErrorResponseContent instead

Type:
  • object | FaunaHttpErrorResponseContent

responseHeaders :object

Type:
  • object

responseRaw :string

Type:
  • string

startTime :number

Type:
  • number

statusCode :number

Type:
  • number