-
Notifications
You must be signed in to change notification settings - Fork 20
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
Expose RAW Response object #25
Comments
Hey, There's no access to the underlying response instance before its completion. I've thought about adding a import { raw } from 'httpie';
async function download(file, writer) {
const resp = await raw('GET', file, ...);
return new Promise((res, rej) => {
resp.on('end', res).on('error', rej);
writer.pipe(resp);
});
} The problem though is that I 100% cannot provide/guarantee any kind of uniformity. Unlike the current Put differently, the above snippet would (and could) only work in Node.js. |
Ah i see i see. okay thank you, this is very helpful. I'll use the built in http method as a replacement. |
No problem. I'll keep this open for any feedback, but I definitely won't consider it a blocker/must-have for the next version release. |
We ran into a related issue. We're talking to the authorize.net API, and even though its responses include the header So, we need to transform it or something before httpie does its JSON decoding and returns a rejection that doesn't include the body that would let us hack around it. |
Including the raw response in the rejection would let us work around the authorize.net stupidity well enough |
NOTE: not really an issue
i want to preform the following using httpie
whats the best way of doing so?
double note: im asking here as it might be a good example to have for other users
The text was updated successfully, but these errors were encountered: