Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

97 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@artiefuzzz/lynx

Lightweight HTTP client Inspired by @augu/orchid and centra

Installation

NPM:

npm install @artiefuzzz/lynx

Yarn:

yarn add @artiefuzzz/lynx

Usage

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

About

Lightweight HTTP client

Resources

Stars

1 star

Watchers

1 watching

Forks

Used by

Contributors

Languages