Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Pass request options to transport (request) #26

Closed
sdbondi opened this issue Mar 2, 2018 · 1 comment · Fixed by #30
Closed

Pass request options to transport (request) #26

sdbondi opened this issue Mar 2, 2018 · 1 comment · Fixed by #30

Comments

@sdbondi
Copy link

sdbondi commented Mar 2, 2018

Hi there

Currently, there is no way to pass options to the underlying client library.

For example:

.configure(rest(config.url).request(request, {agentOptions: { rejectUnauthorized: false }}))

In the code it seems like this.options in Base is not used.

Perhaps doing the following would help: https://github.com/fixate/rest-client/blob/pr/allow-options/lib/request.js#L8

@daffl
Copy link
Member

daffl commented Mar 4, 2018

This is a good suggestions, specifically for Request though, you can already do this using request.defaults as shown in the documentation:

const request = require('request');
const requestClient = request.defaults({
  rejectUnauthorized: false 
});

app.configure(restClient.request(requestClient));

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants