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

Provide better json support for servers don't support chunked request body (re-open) #55583

Closed
doggy8088 opened this issue Jul 13, 2021 · 5 comments

Comments

@doggy8088
Copy link

doggy8088 commented Jul 13, 2021

Refer to #49357

As the issue #49357 been closed due to this comment:

Given there is no detail about wide-spread server usage with chunked encoding disabled / not working, we should close this until more evidence appears.

I have to say the Azure Logic App HTTP trigger doesn't support "chunked encoding". In Handle large messages with chunking in Azure Logic Apps doc, it says:

Logic App triggers don't support chunking because of the increased overhead of exchanging multiple messages.

I was trying to POST a message to Azure Logic App with a HTTP trigger. It because HttpClient's PostAsJsonAsync ONLY support chunked encoding by default. I know what @davidfowl said not recommend buffering for large JSON payloads, but most of the payload to the Azure Logic App are really small. I think it should have an straightforward option to use PostAsJsonAsync without chunked encoding.

@dotnet-issue-labeler dotnet-issue-labeler bot added area-System.Net.Http untriaged New issue has not been triaged by the area owner labels Jul 13, 2021
@ghost
Copy link

ghost commented Jul 13, 2021

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

Refer to #49357

As the issue #49357 been closed due to this comment:

Given there is no detail about wide-spread server usage with chunked encoding disabled / not working, we should close this until more evidence appears.

I have to say the Azure Logic App HTTP trigger doesn't support "chunked encoding". (I'm still confusing why it doesn't support.)

I was trying to POST a message to Azure Logic App with a HTTP trigger. It because HttpClient's PostAsJsonAsync ONLY support chunked encoding by default. I know what @davidfowl said not recommend buffering for large JSON payloads, but most of the payload to the Azure Logic App are really small. I think it should have an straightforward option to use PostAsJsonAsync without chunked encoding.

Author: doggy8088
Assignees: -
Labels:

area-System.Net.Http, untriaged

Milestone: -

@davidfowl
Copy link
Member

The workaround looks pretty good:

var content = JsonContent.Create<T>(json);
await content.LoadIntoBufferAsync();
var response = await httpClient.PostAsync(url, content);

@doggy8088
Copy link
Author

I agreed. I think this should be documented somewhere.

@karelz
Copy link
Member

karelz commented Jul 15, 2021

Triage: This is general problem that the server is violating HTTP spec and does not support chunking.
Above is a workaround how to trick HttpClient into NOT sending chunking.

We believe that this issue is currently good enough documentation. We won't update official docs, unless we have few more reports. If you run into this, please upvote to post, or create new issue and link this one (if this one is locked by then).

@doggy8088 can you please file an issue against Azure Logic App service? They should be aware and primarily make their server compliant.

@karelz karelz closed this as completed Jul 15, 2021
@karelz karelz added this to the 6.0.0 milestone Jul 15, 2021
@doggy8088
Copy link
Author

doggy8088 commented Jul 15, 2021

@karelz I can find out there is an UserVoice item here: https://feedback.azure.com/forums/287593-logic-apps/suggestions/33616297-implement-chunked-transfer-encoding-inside-logic-a

@ghost ghost locked as resolved and limited conversation to collaborators Aug 14, 2021
@karelz karelz removed the untriaged New issue has not been triaged by the area owner label Oct 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants