Class: HttpRequestBuilder

vertx-web-client-js/http_request_builder~ HttpRequestBuilder

new HttpRequestBuilder()

A builder for configuring client-side HTTP requests.

Source:

Methods

host(value) → {HttpRequestBuilder}

Configure the builder to use a new host value.
Parameters:
Name Type Description
value string
Source:
Returns:
a new HttpRequestBuilder instance with the specified host value
Type
HttpRequestBuilder

method(value) → {HttpRequestBuilder}

Configure the builder to use a new method value.
Parameters:
Name Type Description
value Object
Source:
Returns:
a new HttpRequestBuilder instance with the specified method value
Type
HttpRequestBuilder

port(value) → {HttpRequestBuilder}

Configure the builder to use a new port value.
Parameters:
Name Type Description
value number
Source:
Returns:
a new HttpRequestBuilder instance with the specified port value
Type
HttpRequestBuilder

putHeader(name, value) → {HttpRequestBuilder}

Configure the builder to add a new HTTP header.
Parameters:
Name Type Description
name string the header name
value string the header value
Source:
Returns:
a new HttpRequestBuilder instance with the specified header
Type
HttpRequestBuilder

requestURI(value) → {HttpRequestBuilder}

Configure the builder to use a new request URI value.
Parameters:
Name Type Description
value string
Source:
Returns:
a new HttpRequestBuilder instance with the specified request URI value
Type
HttpRequestBuilder

send(codec, handler)

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

sendBuffer(body, handler)

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

sendJson(body, handler)

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

sendStream(body, handler)

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

timeout(value) → {HttpRequestBuilder}

Configures the amount of time in milliseconds after which if the request does not return any data within the timeout period an TimeoutException fails the request.

Setting zero or a negative value disables the timeout.

Parameters:
Name Type Description
value number The quantity of time in milliseconds.
Source:
Returns:
a new HttpRequestBuilder instance with the specified timeout
Type
HttpRequestBuilder