1.2.4 • Published 8 years ago

cockrel-request v1.2.4

Weekly downloads
2
License
ISC
Repository
github
Last release
8 years ago

cockrel-request

Cockrel plugin for making HTTP requests

Install

Require cockrel and pass it to cockrel-request to load the plugin:

const co = require('cockrel');

require('cockrel-request')(co); // Good to go!

Usage

cockrel-request is a wrapper around request and follows the same basic conventions. It exposes several new step methods:

cockrel-request sets two default options differently to standard request, we set json : true by default and add a User-Agent header 'cockrel-request', both of these can be over-ridden by passing them as options.

request

Use the request API to GET some data from github about my user:

const co = require('cockrel');
require('cockrel-request')(co); 

const url = 'https://api.github.com/users/g5095';

co.request(args).do(console.log).begin();

If no options are passed at all, the value of the previous step will be used.

1.2.4

8 years ago

1.2.3

8 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago