2.0.0 • Published 8 years ago
api-bro v2.0.0
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
2.0.0
8 years ago
2.0.0-rc5
9 years ago
2.0.0-rc4
9 years ago
2.0.0-rc3
9 years ago
2.0.0-rc2
9 years ago
2.0.0-rc1
9 years ago
1.3.9
9 years ago
1.3.8
9 years ago
1.3.7
9 years ago
1.3.6
9 years ago
1.3.5
9 years ago
1.3.4
9 years ago
1.3.3
9 years ago
1.3.1
9 years ago
1.3.0
9 years ago
1.2.0
10 years ago
1.1.10
10 years ago
1.1.9
10 years ago
1.1.8
10 years ago
1.1.7
10 years ago
1.1.6
10 years ago
1.1.5
10 years ago
1.1.4
10 years ago
1.1.3
10 years ago
1.1.2
10 years ago
1.1.1
10 years ago
1.1.0
10 years ago
1.0.5
10 years ago
1.0.4
10 years ago
1.0.3
10 years ago
1.0.2
10 years ago
1.0.1
10 years ago
1.0.0
10 years ago