@artiefuzzz/lynx
v2.5.6
Published
Lightweight HTTP client
Maintainers
Readme
@artiefuzzz/lynx
Lightweight HTTP client Inspired by
@augu/orchidandcentra
Installation
NPM:
npm install @artiefuzzz/lynxYarn:
yarn add @artiefuzzz/lynxUsage
Note: Although we are using import { request } from '@artiefuzzz/lynx' it still is the same as using const { request } = require('@artiefuzzz/lynx')
Simple GET request:
import { request } from "@artiefuzzz/lynx";
const response = await request(
"https://jsonplaceholder.typicode.com/todos/1"
).send();
console.log(response.json);Simple POST request:
import { request, SendAs } from "@artiefuzzz/lynx";
const response = await request(
"https://jsonplaceholder.typicode.com/posts",
"POST"
)
.body(
{
title: "Hello World!",
body: "foobar",
userId: 101,
},
SendAs.JSON
)
.send();
console.log(response.json);If you encounter an issue please open a Issue on the Repository here
