Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for defaults #85

Merged
merged 1 commit into from Jun 19, 2015
Merged

add support for defaults #85

merged 1 commit into from Jun 19, 2015

Conversation

@jmonster
Copy link
Contributor

jmonster commented May 20, 2015

reason

One of my favorite features of node-request is using defaults to create a mostly configured instance ... but since it never seems to work right, I decided to switch to wreck and implement the behavior here instead 馃憤

usage

var wreck = Wreck.defaults({
  headers: {
    'authorization': 'asdf-1234-qwer-5678-zxcv',
    'host': 'api.foo.com',
    'timeout': 3000,
    'accept': 'application/json',
  }
});

wreck.get('/apps', function(err, res, payload) {
  /* stuff */
});
@jmonster jmonster force-pushed the jmonster:defaults branch from 3be5fed to f69cc37 May 20, 2015
@@ -695,7 +695,6 @@ describe('request()', function () {
expect(Object.keys(agent.sockets).length).to.equal(0);

Wreck.request('get', 'http://localhost/', { agent: agent }, function (err, res) {

This comment has been minimized.

Copy link
@AdriVanHoudt

AdriVanHoudt May 21, 2015

Contributor

this line still needs to be here (hapi style guide)

This comment has been minimized.

Copy link
@jmonster

jmonster May 21, 2015

Author Contributor

unintended change; fixing.

@jmonster jmonster force-pushed the jmonster:defaults branch from f69cc37 to 73a9411 May 21, 2015
@geek geek added the feature label May 27, 2015
@geek geek added this to the 5.5.2 milestone May 27, 2015
@geek geek self-assigned this May 27, 2015
@geek

This comment has been minimized.

Copy link
Member

geek commented May 27, 2015

@jmonster looks good on the code front. Only have a couple of minor style issues that now show in travis: https://travis-ci.org/hapijs/wreck/jobs/63415919

@jmonster

This comment has been minimized.

Copy link
Contributor Author

jmonster commented Jun 6, 2015

Been busy but I plan to follow up on this!

@jmonster jmonster force-pushed the jmonster:defaults branch from 73a9411 to 48aad49 Jun 12, 2015
@jmonster jmonster force-pushed the jmonster:defaults branch from 48aad49 to 1a378f4 Jun 12, 2015
@jmonster

This comment has been minimized.

Copy link
Contributor Author

jmonster commented Jun 12, 2015

Updated -- fyi, npm test on my local machine it not triggering the linting to run (?)

geek added a commit that referenced this pull request Jun 19, 2015
add support for defaults
@geek geek merged commit d86b7b6 into hapijs:master Jun 19, 2015
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can鈥檛 perform that action at this time.