# Class: HttpResponseTemplate

## vertx-web-client-js/http_response_template~ HttpResponseTemplate

#### new HttpResponseTemplate()

A template for configuring client-side HTTP responses.

Source:
  - vertx-web-client-js/http_response_template.js, line 32

### Methods

#### asJsonObject() → {HttpResponseTemplate}

Configure the template to decode the response as a Json object.

Source:
  - vertx-web-client-js/http_response_template.js, line 141

##### 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:
  - vertx-web-client-js/http_response_template.js, line 125

##### Returns:

Type
  HttpResponseTemplate

#### send(handler)

Send a request, the `handler` will receive the response as an HttpResponse.

##### Parameters:

Name | Type | Description
--- | --- | ---
`handler` | function |

Source:
  - vertx-web-client-js/http_response_template.js, line 44

#### sendBuffer(body, handler)

Like HttpResponseTemplate#send but with an HTTP request `body` buffer.

##### Parameters:

Name | Type | Description
--- | --- | ---
`body` | Buffer | the body
`handler` | function |

Source:
  - vertx-web-client-js/http_response_template.js, line 84

#### 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:
  - vertx-web-client-js/http_response_template.js, line 105

#### sendStream(body, handler)

Like HttpResponseTemplate#send but with an HTTP request `body` stream.

##### Parameters:

Name | Type | Description
--- | --- | ---
`body` | ReadStream | the body
`handler` | function |

Source:
  - vertx-web-client-js/http_response_template.js, line 64