0.2.1 • Published 6 years ago
@calmdownval/httpx-client v0.2.1
httpx-client
This module uses the ES modules feature and requires Node v8.15.0+. Please refer to Node's documentation to read more on how to enable this functionality in your environment.
Client for making HTTP requests in both NodeJS and the browser. Supports HTTP/1, HTTP/1.1 and HTTP/2.0 with auto-detection.
There is still some work to be done on this module (mainly tests, probably some bugs & writing some docs).
Installation
npm install @calmdownval/httpx-client
Usage
import httpx from '@calmdownval/httpx-client';
(async () =>
{
const { data } = await httpx('http://google.com');
console.log(data);
})();
outputs something like:
{
status: 301,
headers: {
location: 'http://www.google.com/',
// ...
},
data: '<HTML>...',
httpVersion: '1.1' // only present in NodeJS
}