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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allowUnmocked + POST requests not working #91

Closed
rgarcia opened this issue Feb 4, 2013 · 3 comments
Closed

allowUnmocked + POST requests not working #91

rgarcia opened this issue Feb 4, 2013 · 3 comments

Comments

@rgarcia
Copy link

rgarcia commented Feb 4, 2013

nock('https://httpbin.org', { allowUnmocked: true }).get("/abc").reply(200, "Hey!");

var options = {
  method: 'post',
  uri: 'https://httpbin.org/post',
  json: { some: 'data' }
};
request(options, function(err, resp, body) {
  console.log(resp.statusCode, body);
});

The console.log is never run. The same code works if you do any of the following:

  • remove allowUnmocked: true
  • change the request to a 'get' on '/' with no body
@rgarcia
Copy link
Author

rgarcia commented Feb 4, 2013

The code also works if you remove the json body, surprisingly.

@pgte pgte closed this as completed in b4bc405 Feb 5, 2013
@pgte
Copy link
Member

pgte commented Feb 5, 2013

Should be fixed in v0.15.2.

@lock
Copy link

lock bot commented Sep 14, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue and add a reference to this one if it’s related. Thank you!

@lock lock bot locked as resolved and limited conversation to collaborators Sep 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants