Module: selenium-webdriver/http
View Source

# class HttpClient

All implemented interfaces
  `webdriver.http.Client`

A `webdriver.http.Client` implementation using Node's built-in http module.

### new HttpClient(serverUrl, opt_agent, opt_proxy)

Parameters

serverUrl`string`

  URL for the WebDriver server to send commands to.

opt_agent`?http.Agent=`

  The agent to use for each request. Defaults to `http.globalAgent`.

opt_proxy`string=`

  The proxy to use for the connection to the server. Default is to use no proxy.

## Instance Methods

### send(request, callback)code »

Sends a request to the server. If an error occurs while sending the request, such as a failure to connect to the server, the provided callback will be invoked with a non-null `Error` describing the error. Otherwise, when the server's response has been received, the callback will be invoked with a null Error and non-null `webdriver.http.Response` object.

Specified by: webdriver.http.Client

Parameters

request`webdriver.http.Request`

  The request to send.

callback`function(Error, webdriver.http.Response=): ?`

  the function to invoke when the server's response is ready.