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

httpc:request full_result option does not work in async mode #8538

Open
Xavier59 opened this issue May 31, 2024 · 2 comments
Open

httpc:request full_result option does not work in async mode #8538

Xavier59 opened this issue May 31, 2024 · 2 comments
Assignees
Labels
bug Issue is reported as a bug team:PS Assigned to OTP team PS

Comments

@Xavier59
Copy link

Xavier59 commented May 31, 2024

Describe the bug
As per erlang documentation on httpc:request options:

full_result - Defines if a "full result" is to be returned to the caller (that is, the body, the headers, and the entire status line) or not (the body and the status code).

Default is true.

It it not specified that it does not apply if the request is async. The logical conclusion is that it applies to both.

To Reproduce
Steps to reproduce the behavior.

inets:start(),
httpc:request(get, {"http://example.com/", []}, [], [{full_result, false}]),
httpc:request(get, {"http://example.com/", []}, [], [{full_result, false}, {sync, false}, {receiver, fun(ReplyInfo) -> io:format("~p", [ReplyInfo]) end}]).

Expected behavior
Both request should have a result of the type {StatusCode, HttpBodyResult}
However, first request has a result of the type {StatusCode, HttpBodyResult} but second request (async) has a result of the type {StatusLine, [HttpHeader], HttpBodyResult}

Either the return of async request should be {StatusCode, HttpBodyResult} or the documentation should be clarified.

Affected versions
Latest

@Xavier59 Xavier59 added the bug Issue is reported as a bug label May 31, 2024
@Xavier59 Xavier59 changed the title httpc:request full_result options does not work in async mode httpc:request full_result option does not work in async mode May 31, 2024
@IngelaAndin IngelaAndin added the team:PS Assigned to OTP team PS label Jun 3, 2024
IngelaAndin added a commit to IngelaAndin/otp that referenced this issue Jun 4, 2024
@IngelaAndin
Copy link
Contributor

IngelaAndin commented Jun 4, 2024

@Xavier59 hum we will look into it.

@Whaileee
Copy link
Contributor

Whaileee commented Jul 2, 2024

It appears that async mode doesn't support some of the options, but the solution is in progress currently

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is reported as a bug team:PS Assigned to OTP team PS
Projects
None yet
Development

No branches or pull requests

3 participants