🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

api-bro

Package Overview
Dependencies
Maintainers
2
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

api-bro

```js import { default as ApiBro } from 'api-bro'

2.0.0
unpublished
latest
Source
npm
Version published
Weekly downloads
0
Maintainers
2
Weekly downloads
 
Created
Source

ApiBro

import { default as ApiBro } from 'api-bro'

const client = new ApiBro({
  pathPrefix: 'https://path.to.your.api.endpoint',
  globalHeaders: {
    Authorization: `Bearer ${token}`
  }
})

client.get('apples', { params: { green: true, red: true } }).then(...)
client.post('apples/store', { data: { apples: [...] } })
client.patch ...
client.del ...
client.put ...
// or if you're using cookies
const client = new ApiBro({
  pathPrefix: 'https://path.to.your.api.endpoint',
  withCredentials: true
})

Optional parameters

withCredentials Add withCredentials() to all requests.

pathPrefix Add a prefixed string to each request.

globalHeaders Add headers to each request.

globalParams Add params to all applicable requests.

globalData Add data to all applicable requests

FAQs

Package last updated on 11 Jan 2017

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