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

@alphatango/httpclient

Package Overview
Dependencies
Maintainers
5
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alphatango/httpclient

A wrapper around axios with retry and caching logic, bearer token injection through custom resolvers and extended logging

  • 0.0.11
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
5
Weekly downloads
 
Created
Source

ATSquad HTTP Client

A wrapper around axios with retry and caching logic, bearer token injection through custom resolvers, and extended logging.

Using this library

Install the library.

yarn add @alphatango/httpclient
const HttpClient = require('@alphatango/httpclient');
const Logger = require('@alphatango/logger');

let logger = new Logger();
let httpClient = new HttpClient({
  logFunction: msg => logger.log(msg),
  tokenResolver: () => "exampleAccessToken"
});

let headers = {};
let data = { exampleProperty: 'exampleValue' };

let getResponse = await httpClient.get('VALID_URL', { headers });
let postResponse = await httpClient.post('VALID_URL', data, { headers });
let putResponse = await httpClient.put('VALID_URL', data, { headers });

If you wish to override the axios defaults and/or add your own interceptors, provide an axios instance in the configuration object.

const axios = require('axios');
let axiosClient = axios.create({ timeout: 3000 });
new HttpClient({ client: axiosClient });

Contribution

We value your input as part of direct feedback to us, by filing issues, or preferably by directly contributing improvements:

  1. Fork this repository
  2. Create a branch
  3. Contribute
  4. Pull request

FAQs

Package last updated on 16 Nov 2020

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