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

Hackney adapter is incompatible with with_body option #102

Closed
christopheradams opened this issue Sep 11, 2017 · 1 comment
Closed

Hackney adapter is incompatible with with_body option #102

christopheradams opened this issue Sep 11, 2017 · 1 comment

Comments

@christopheradams
Copy link

The Hackney adapter allows options to be passed directly to the underlying request function. However, one option that will not work is with_body: true, which returns the body directly, and is needed for the max_body option.

The reason it won't work is that Tesla always tries to read the body from a reference:

https://github.com/teamon/tesla/blob/33417c02d082801013eb4e8a4b3cd3fa78db0d91/lib/tesla/adapter/hackney.ex#L38-L39

Passing with_body: true as an option to Tesla using Hackney will crash with a :req_not_found adapter error.

I believe it might be sufficient to use is_reference/1 as a guard to know whether the body needs to be read or not.

@teamon
Copy link
Member

teamon commented Sep 11, 2017

Closing since #103 is now merged.
@christopheradams feel free to reopen if that does not solve this issue.

@teamon teamon closed this as completed Sep 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants