Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@gwansikk/query-fetch

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gwansikk/query-fetch

The query-fetch is a simple and lightweight HTTP Request library.

  • 0.6.0
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
0
Weekly downloads
 
Created
Source

🔗 Query Fetch

Lightweight and Easy-to-Use Fetch API Extension Library.

npm version npm downloads npm bundle size Codacy Badge

English   •   한국어

Installation

  • NPM
npm i @gwansikk/server-chain
  • Yarn
yarn add @gwansikk/server-chain

Usage

Instance

const server = ServerChain({
  key: 'INSTANCE',
  baseURL: 'https://jsonplaceholder.typicode.com',
});

server.get({ url: 'posts/1' }).then((data) => console.log(data));

Interceptor

const server = ServerChain({
  key: 'INTERCEPTOR',
  baseURL: 'https://jsonplaceholder.typicode.com',
  interceptors: {
    request: (request) => {
      console.log('** request interceptor **');
      // You need to modify the request and return the modified request.
      // For example, you can add a specific header to the request or modify the URL.
      request.headers = {
        ...request.headers,
        Authorization: 'Bearer YOUR_ACCESS_TOKEN',
      };
      return request;
    },
    response: (response) => {
      console.log('** response interceptor **');
      // You need to modify the response and return the modified response.
      return response;
    },
    error: (response) => {
      console.log('** error interceptor **');
      // You need to modify the error response and return the modified response.
      return response;
    },
  },
});

Contributing

Information describing how to contribute can be found in the file.

CONTRIBUTING.md

Keywords

FAQs

Package last updated on 02 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc