4.3.1 • Published 4 years ago

toto-request v4.3.1

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

Toto Request

This library is a wrapper for the https://github.com/request/request NodeJS module.

It provides some basic functionality among which:

How to use

Import the node module var http = require('toto-request');

Call the http() function:

http({
  correlationId:  MANDATORY, 'the correlation id',
  microservice:   MANDATORY, 'the full microservice id (e.g. toto-nodems-expenses)',
  method:         optional, 'the HTTP method: GET, POST, PUT, DELETE, ...'. If not provided, will use 'GET',
  resource:       optional, 'the path to call. e.g. /sessions?date=20192039' including the paramters
});

Passing a body

To pass the body (e.g. for POST requests), just pass a json object as body:

var body = {
  ...
}
http({
  correlationId:  'asdasd',
  microservice:   'expenses',
  method:         'POST',
  resource:       '/expenses',
  body:           body
  });
4.3.1

4 years ago

4.3.0

4 years ago

4.2.0

5 years ago

4.1.0

5 years ago

4.0.0

5 years ago

3.1.0

5 years ago

3.0.0

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago