UNPKG

selenium-webdriver

Version:

The official WebDriver JavaScript bindings from the Selenium project

16 lines 3.67 kB
<!DOCTYPE html><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"><meta http-equiv="Content-Language" content="en"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>HttpClient</title><link href="dossier.css" rel="stylesheet" type="text/css"><header><div><form><div><input type="search" placeholder="Search" tabindex="1"></div></form></div></header><main><article><div class="parentlink"><b>Module:</b> <a href="module_selenium-webdriver_http.html">selenium-webdriver/http</a></div><div class="codelink"><a href="source/http/index.js.src.html#l195">View Source</a></div><h1>class HttpClient</h1><dl><dt>All implemented interfaces<dd><code><a href="interface_webdriver_http_Client.html">webdriver.http.Client</a></code></dl><p>A <a href="interface_webdriver_http_Client.html"><code>webdriver.http.Client</code></a> implementation using Node&#39;s built-in http module.</p> <h3>new HttpClient(<wbr>serverUrl, opt_agent, opt_proxy)</h3><div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>serverUrl<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code><dd><p>URL for the WebDriver server to send commands to.</p> <dt>opt_agent<code>?http.Agent=</code><dd><p>The agent to use for each request. Defaults to <code>http.globalAgent</code>.</p> <dt>opt_proxy<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>=</code><dd><p>The proxy to use for the connection to the server. Default is to use no proxy.</p> </dl></div></div><h2>Instance Methods</h2><div id="send" class="function"><div><h3>send(<wbr>request, callback)<span class="codelink"><a href="source/http/index.js.src.html#l66">code »</a></span></h3><p>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 <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error"><code>Error</code></a> describing the error. Otherwise, when the server&#39;s response has been received, the callback will be invoked with a null Error and non-null <a href="class_webdriver_http_Response.html"><code>webdriver.http.Response</code></a> object.</p> <p><b>Specified by: </b><a href="interface_webdriver_http_Client.html#send">webdriver.http.Client</a></p><div><div class="fn-details"><div><b>Parameters</b></div><dl><dt>request<code><a href="class_webdriver_http_Request.html">webdriver.http.Request</a></code><dd><p>The request to send.</p> <dt>callback<code>function(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Error</a>, <a href="class_webdriver_http_Response.html">webdriver.http.Response</a>=): ?</code><dd><p>the function to invoke when the server&#39;s response is ready.</p> </dl></div></div></div></div></article><nav><h3><a href="index.html" tabindex="2">Overview</a></h3><div><input type="checkbox" id="nav-modules" checked/><label for="nav-modules"><h3><span class="selectable" tabindex="2">Modules</span></h3></label><div id="nav-modules-view"></div></div><div><input type="checkbox" id="nav-types" checked/><label for="nav-types"><h3><span class="selectable" tabindex="2">Types</span></h3></label><div id="nav-types-view"></div></div><h3><a href="Changes.html" tabindex="2">Changes</a></h3></nav></main><footer><div><a href="https://github.com/jleyba/js-dossier">Generated by dossier</a></div></footer><script src="types.js"></script><script src="dossier.js"></script>