glenlivet-fetch
Insert the results of HTTP requests into Glenlivet processing workflows.
Installation
npm install glenlivet-fetch
Usage
var glenlivet = ;var Bottle = glenlivetBottle; glenlivetplugin; var getProlificHome = fetch: uri: 'http://www.prolificinteractive.com' ; getProlificHomehooks; getProlificHome;
HTTP Methods
You can specify GET, POST, PUT, and DELETE methods.
Example:
var bottle = fetch: method: 'POST' bodyType: 'form' //"form" or "json". Defaults to "form". uri: 'http://www.prolificinteractive.com/form'
For PUT and POST requests, bodyType
will specify if the body is serialized as json or form data.
Request Parameters
You can specify various request parameters, which will automatically get mapped to the request.
Example:
var bottle = fetch: method: 'POST' uri: 'http://www.prolificinteractive.com/forms/:form' params: form: type: 'uri' default: 'contact' message: type: 'body' callback_url: type: 'query' referer: type: 'header' default: 'http://www.prolificinteractive.com/form' ;