works with "any HTTP client library" doesn't seem to be true
See original GitHub issueI might be misunderstanding something, but when I tried to use my HTTP client library of choice (superagent) Purest hung indefinitely until I exited the process.
This works:
const request = require('request');
const purest = require('purest')({ request, promise: Promise });
This doesn’t work:
const request = require('superagent');
const purest = require('purest')({ request, promise: Promise });
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
HttpClient PostAsync does not return - Stack Overflow
You can use this var json = JsonConvert.SerializeObject(card); using (var client = new HttpClient()) { var t = await client.
Read more >You're using HttpClient wrong and it is destabilizing your ...
I've been using HttpClient wrong for years and it finally came back to bite me. My site was unstable and my clients furious,...
Read more >How to use ArduinoJson with HTTPClient?
HTTPClient is a class that performs HTTP requests on ESP8266 and ESP32. Assuming that the board is connected to the WiFi network, you...
Read more >HttpClient does not use HTTP proxy when client options ssl ...
I am trying to use the http client in order to access several restful apis through my proxy. Some of the api providers...
Read more >HttpClient SSL Guide
Work-around: One possible solution is to increase the timeout value as the server is taking too long to start sending the response. Alternatively...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @bitinn, Grant uses request-compose under the hood. It’s my latest (and greatest) HTTP client for Node.
It’s not exactly a rewrite of request and that have never been the goal, even though the multipart, oauth and cookie ‘middlewares’ are taken straight from request. They were initially extracted out for my actual rewrite, @request/core, a few years ago. request-logs is taken from @request/log initially implemented for @request/core.
It’s possible to add request-compose as optional HTTP client here, unfortunately it can’t be set as default one without major release, because it have some differences with request, namely it’s not a duplex stream, and also it doesn’t implement the @request/interface strictly. And this is going to be yet another breaking change and not fully backward compatible version.
I agree, though I don’t think it was intentional.
I guess I got a bit carried out with the use of the word any because it’s certainly true for Promise implementations and REST APIs, but not so much for HTTP clients apparently.
Probably I had the intention to create those wrappers, can’t tell you for sure. Currently only request and @request/client fully implement the interface. @request/core was my attempt to rewrite request long time ago, and it was covering the entire request test suit at that time, so it’s pretty stable and feature rich as it is. I always pair it with Purest, however the code base suffers from other issues and I can’t recommend using it because no one is maintaining it. You can try it out of course and see if it works for you as it is.
Anyway, thanks for your feedback! I’m going to update the readme and phrase it more correctly. 👍