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

axios-easy-auth

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

axios-easy-auth

Modified axios with a simple addition of headers

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Were there any problems adding headers to the request?

This library makes it easy.


const auth = new EasyAuth('https://site.com', 'Bearer token')

First we need to create the EasyAuth class. Parameters accept site url, access token.


const postData = async () => {
    const responce = await auth.post('/posts', {}, {Header: 'value'}) 
    console.log('POST')
    console.log(responce.data)
}
// post(path: string, body: array, headers: array)

Then you can make requests to the server. EasyAuth supports GET, POST, PUT, PATCH, DELETE methods. Documentation for all methods on github. Please write about errors there.

Пример: https://github.com/KirillUsenko/examples-axios-easy-auth



Были проблемы с добавлением хэдеров в запрос?

Данная библиотека упрощает это.


const auth = new EasyAuth('https://site.com', 'Bearer token')

Для начала нужно создать класс EasyAuth. Параметрами принимает url сайта, access токен.


const postData = async () => {
    const responce = await auth.post('/posts', {}, {Header: 'value'}) 
    console.log('POST')
    console.log(responce.data)
}
// post(path: string, body: array, headers: array)

Далее можно делать запросы на сервер. EasyAuth поддерживает методы GET, POST, PUT, PATCH, DELETE. Документация для всех методов на github. Про ошибки пишите туда же.

Пример: https://github.com/KirillUsenko/examples-axios-easy-auth



Donate

if you like the library, you can buy it on privjs.
https://app.privjs.com/my-package?pkg=axios-easy-auth
Well, or you can throw money on the card 2200 7005 0030 3994)

Keywords

FAQs

Package last updated on 28 Aug 2022

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