@agnostack/aftership-request
🎮 Minimal AfterShip API request library for Node
Installation
yarn add @agnostack/aftership-request # npm install @agnostack/aftership-request
Quickstart (OAuth)
const createClient = ;// import { createClient } from '@agnostack/aftership-request' const aftership = api_key: '...' // AfterShip API key.; aftership ; aftership ; aftership ;
Kitchen sink
const aftership = api_key: '...' api_domain: '...' version: 'v4' headers: // ... ;
Custom headers per request
The API provides you the ability to send various request headers that change the way data is stored or retrieved.
By default this library will encode all data as JSON, however you can customise this by setting your own Content-Type
header as an additional argument to get
, post
, put
and delete
.
Note: If you add the Content-Type
custom header to post
, put
or delete
you will need to encode data
yourself.
const aftership = api_key: '...'; const headers = 'X-My-Header': 'custom'; aftership ;
Contact Adam Grohs @ agnoStack for any questions.