https://github.com/watchdg/node-http-instance-request
https://github.com/watchdg/node-http-instance-request
Last synced: 10 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/watchdg/node-http-instance-request
- Owner: WatchDG
- License: mit
- Created: 2021-03-06T12:29:56.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-05-29T06:02:21.000Z (about 5 years ago)
- Last Synced: 2025-02-06T23:46:22.462Z (over 1 year ago)
- Language: TypeScript
- Size: 10.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# http-instance-request
## install
```shell
yarn install http-instance-request
# or
npm install http-instance-request
```
## example
```ts
import {request} from "http-instance-request";
import {URL} from "url";
(async () => {
const {status, headers, body} = (await request({
url: new URL('https://example.com'),
options: {
method: 'GET'
}
})).unwrap();
console.log('> status:', status);
console.log('> headers:', headers);
console.log('> body:', body);
})();
```