# Class: HttpClientRequest

## vertx-js/http_client_request~ HttpClientRequest

#### new HttpClientRequest()

  Represents a client-side HTTP request.

  Source:
    - http_client_request.js, line 34

### Methods

#### continueHandler(handler) → {HttpClientRequest}

  If you send an HTTP request with the header `Expect` set to the value `100-continue` and the server responds with an interim HTTP response with a status code of `100` and a continue handler has been set using this method, then the `handler` will be called.

  You can then continue to write data to the request body and later end it. This is normally used in conjunction with the HttpClientRequest#sendHead method to force the request header to be written before the request has ended.

  ##### Parameters:

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

  Source:
    - http_client_request.js, line 281

  ##### Returns:

  a reference to this, so the API can be used fluently
  Type
    HttpClientRequest

#### drainHandler(handler) → {HttpClientRequest}

  ##### Parameters:

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

  Source:
    - http_client_request.js, line 113

  ##### Returns:

  Type
    HttpClientRequest

#### end(chunk, enc)

  Same as HttpClientRequest#end but writes a String with the specified encoding

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `chunk` | string |
  `enc` | string |

  Source:
    - http_client_request.js, line 315

#### endHandler(endHandler) → {HttpClientRequest}

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `endHandler` | function |

  Source:
    - http_client_request.js, line 171

  ##### Returns:

  Type
    HttpClientRequest

#### exceptionHandler(handler) → {HttpClientRequest}

  ##### Parameters:

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

  Source:
    - http_client_request.js, line 61

  ##### Returns:

  Type
    HttpClientRequest

#### handler(handler) → {HttpClientRequest}

  ##### Parameters:

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

  Source:
    - http_client_request.js, line 127

  ##### Returns:

  Type
    HttpClientRequest

#### headers() → {MultiMap}

  Source:
    - http_client_request.js, line 243

  ##### Returns:

  - The HTTP headers
  - Type
      MultiMap

#### isChunked() → {boolean}

  Source:
    - http_client_request.js, line 201

  ##### Returns:

  - Is the request chunked?
  - Type
      boolean

#### method() → {Object}

  The HTTP method for the request.
  Source:
    - http_client_request.js, line 215

  ##### Returns:

  Type
    Object

#### pause() → {HttpClientRequest}

  Source:
    - http_client_request.js, line 143

  ##### Returns:

  Type
    HttpClientRequest

#### putHeader(name, value) → {HttpClientRequest}

  Put an HTTP header

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `name` | string | The header name
  `value` | string | The header value

  Source:
    - http_client_request.js, line 261

  ##### Returns:

  a reference to this, so the API can be used fluently
  Type
    HttpClientRequest

#### resume() → {HttpClientRequest}

  Source:
    - http_client_request.js, line 157

  ##### Returns:

  Type
    HttpClientRequest

#### sendHead() → {HttpClientRequest}

  Forces the head of the request to be written before HttpClientRequest#end is called on the request or any data is written to it.

  This is normally used to implement HTTP 100-continue handling, see HttpClientRequest#continueHandler for more information.

  Source:
    - http_client_request.js, line 300

  ##### Returns:

  a reference to this, so the API can be used fluently
  Type
    HttpClientRequest

#### setChunked(chunked) → {HttpClientRequest}

  If chunked is true then the request will be set into HTTP chunked mode

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `chunked` | boolean | true if chunked encoding

  Source:
    - http_client_request.js, line 186

  ##### Returns:

  a reference to this, so the API can be used fluently
  Type
    HttpClientRequest

#### setTimeout(timeoutMs) → {HttpClientRequest}

  Set's the amount of time after which if a response is not received TimeoutException will be sent to the exception handler of this request.

  Calling this method more than once has the effect of canceling any existing timeout and starting the timeout from scratch.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `timeoutMs` | number | The quantity of time in milliseconds.

  Source:
    - http_client_request.js, line 339

  ##### Returns:

  a reference to this, so the API can be used fluently
  Type
    HttpClientRequest

#### setWriteQueueMaxSize(maxSize) → {HttpClientRequest}

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `maxSize` | number |

  Source:
    - http_client_request.js, line 99

  ##### Returns:

  Type
    HttpClientRequest

#### uri() → {string}

  Source:
    - http_client_request.js, line 229

  ##### Returns:

  - The URI of the request.
  - Type
      string

#### write(chunk, enc) → {HttpClientRequest}

  Write a String to the request body, encoded using the encoding `enc`.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `chunk` | string |
  `enc` | string |

  Source:
    - http_client_request.js, line 79

  ##### Returns:

  @return a reference to this, so the API can be used fluently
  Type
    HttpClientRequest

#### writeQueueFull() → {boolean}

  This will return `true` if there are more bytes in the write queue than the value set using HttpClientRequest#setWriteQueueMaxSize
  Source:
    - http_client_request.js, line 48

  ##### Returns:

  true if write queue is full
  Type
    boolean