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

Question: 'request' package supported with browserify? #332

Closed
timfpark opened this issue Mar 20, 2013 · 1 comment
Closed

Question: 'request' package supported with browserify? #332

timfpark opened this issue Mar 20, 2013 · 1 comment

Comments

@timfpark
Copy link

I hope this isn't a dumb question, but I'm trying to use the 'request' npm module with browserify to convert and I'm having trouble and my plea for help on stackoverflow has gone unanswered. :(

The code I have is pretty standard, I'm posting a request to the server from the browserified version with something like:

request.post("http://mysite.com/comments", { json: self }, function(err, resp, body) {
  // ... handle response here ...
});

The POST is made and I see in the Chrome network tab that the request is successful -- but I'm not getting called back from request.

Do I need to substitute a client version of 'request' for the node.js one (ala https://github.com/iriscouch/browser-request)? If so, how do I do that - the sample code in fake.js seems to only work for project code and not modules?

Thanks for your work on this project - its a great tool.

@ghost
Copy link

ghost commented Mar 21, 2013

Previous versions of request worked with previous versions of browserify but the latest version of each do not work well with each other. Other folks have already noticed this issue and have posted it to request's issues page. In the meantime you can use tools like browser-request like you mention or if you want .pipe() hyperquest works in browsers.

@ghost ghost closed this as completed Mar 21, 2013
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant