node_two_captcha_fork_emd
Version:
Node.js package for easy integration with 2Captcha API (Captcha Solver as a Service)
670 lines (191 loc) • 8.38 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: HTTPRequest</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: HTTPRequest</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>HTTPRequest<span class="signature">()</span><span class="type-signature"></span></h2>
<div class="class-description">Class with static methods used in HTTP requests</div>
</header>
<article>
<div class="container-overview">
<h2>Constructor</h2>
<h4 class="name" id="HTTPRequest"><span class="type-signature"></span>new HTTPRequest<span class="signature">()</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="http_request.js.html">http_request.js</a>, <a href="http_request.js.html#line10">line 10</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id=".openDataURL"><span class="type-signature">(async, static) </span>openDataURL<span class="signature">(url)</span><span class="type-signature"> → {Promise.<Buffer>}</span></h4>
<div class="description">
Performs a GET to an URL and returns a promise to its body as a Buffer
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>url</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">URL of the desired content to GET</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="http_request.js.html">http_request.js</a>, <a href="http_request.js.html#line18">line 18</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Buffer with the content of the body from the HTTP response
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<Buffer></span>
</dd>
</dl>
<h4 class="name" id=".request"><span class="type-signature">(async, static) </span>request<span class="signature">(options)</span><span class="type-signature"> → {Promise.<string>}</span></h4>
<div class="description">
Performs a request and returns a promise to the body as a string
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">Object with the parameters to the request
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>url</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last">URL of the request</td>
</tr>
<tr>
<td class="name"><code>method</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
'get'
</td>
<td class="description last">HTTP verb of the request</td>
</tr>
<tr>
<td class="name"><code>payload</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
{}
</td>
<td class="description last">Body content of the requisition</td>
</tr>
<tr>
<td class="name"><code>timeout</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="default">
60000
</td>
<td class="description last">Timeout of the request in miliseconds</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="http_request.js.html">http_request.js</a>, <a href="http_request.js.html#line38">line 38</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.<string></span>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Captcha.html">Captcha</a></li><li><a href="HTTPRequest.html">HTTPRequest</a></li><li><a href="TwoCaptchaClient.html">TwoCaptchaClient</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.7</a> on Mon May 17 2021 19:14:49 GMT-0300 (Brasilia Standard Time)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>