1.0.0 • Published 5 years ago

request-f v1.0.0

Weekly downloads
11
License
MIT
Repository
github
Last release
5 years ago

request-f

Fantasy Land Future compatible request library based on request, fluture and sancturay.

Methods

Every methods have next signature.

<methodName> :: String s -> Future a s
<methodName> :: RequestOptions o -> Future a o

List of RequestOptions see here

Examples

Simple example

const requestF = require('request-f');

requestF
  .get('http://site.com')
  .fork(console.error, console.log);
  // -> Right({ body: '...', statusCode: '...', headers: { ... } })

Using with Sanctuary

const { create, env } = require('sanctuary');
const { env: flutureEnv } = require('fluture-sanctuary-types');

const S = create({
  checkTypes: true,
  env: env.concat(flutureEnv),
});

const getBody = S.map(S.prop('body'));

requestF
  .get('http://site.com')
  .map(getBody)
  .fork(console.error, console.log);
  // -> Right('<body value>')

Learn more about integration fluture with sanctuary


MIT License

1.0.0

5 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago