Class: HttpResponseTemplate

vertx-web-client-js/http_response_template~ HttpResponseTemplate

new HttpResponseTemplate()

A template for configuring client-side HTTP responses.
Source:

Methods

asJsonObject() → {HttpResponseTemplate}

Configure the template to decode the response as a Json object.
Source:
Returns:
a new HttpResponseTemplate instance decoding the response as a Json object
Type
HttpResponseTemplate

asString(encoding) → {HttpResponseTemplate}

Like HttpResponseTemplate#asString but with the specified encoding param.
Parameters:
Name Type Description
encoding string
Source:
Returns:
Type
HttpResponseTemplate

send(handler)

Send a request, the handler will receive the response as an HttpResponse.
Parameters:
Name Type Description
handler function
Source:

sendBuffer(body, handler)

Like HttpResponseTemplate#send but with an HTTP request body buffer.
Parameters:
Name Type Description
body Buffer the body
handler function
Source:

sendJson(body, handler)

Like HttpResponseTemplate#send but with an HTTP request body json and the content type set to application/json.
Parameters:
Name Type Description
body Object the body
handler function
Source:

sendStream(body, handler)

Like HttpResponseTemplate#send but with an HTTP request body stream.
Parameters:
Name Type Description
body ReadStream the body
handler function
Source: