Request Bin Client
Introduction
Request Bin is a pretty useful service (I've used it to test webhooks, for example) and it's API is relatively straight-forward, to boot!
Currently, there's a Request Bin client via the requestbin
NPM package, however, it has a callback-based API while this client is Promise
-based.
Installation
Install via the NPM package
npm install request-bin
API
createBin
- Creates a bin and returns a
Promise
containing bin details - Takes an optional
isPrivate
parameter - the default value isfalse
; // Prints public bin detailsRequestBinClient; // Prints private bin detailsRequestBinClient;
getBin(binId)
- Returns a
Promise
containing bin details for a givenbinId
; const binId = 'someBinId'; // Prints bin's detailsRequestBinClient;
getRequests(binId)
- Returns a
Promise
containing for HTTP request details for a specific bin
; const binId = 'someBinId'; // Prints bin's requests detailsRequestBinClient;
getRequest(binId, requestId)
- Returns a
Promise
containing details for a specific HTTP request made against a specific bin
; const binId = 'someBinId';const requestId = 'someRequestId'; // Prints request details for a specific request in a binRequestBinClient;