[ 
https://issues.apache.org/jira/browse/HTTPCORE-732?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17676007#comment-17676007
 ] 

Oleg Kalnichevski commented on HTTPCORE-732:
--------------------------------------------

> so why doesn't HC client do that for me? 

[~jcompan...@gmail.com] Because content-length in HTTP/2 messages is redundant 
and just not useful. If there is a special case where presence of 
content-length is required or can be potentially useful, one can easily add it 
with a custom request or execution interceptor, like the one you are referring 
to.

Oleg

> Is it onpurpose that content-length header is not set in http/2 mode?
> ---------------------------------------------------------------------
>
>                 Key: HTTPCORE-732
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-732
>             Project: HttpComponents HttpCore
>          Issue Type: Improvement
>          Components: HttpCore
>    Affects Versions: 5.1.4
>            Reporter: Johan Compagner
>            Priority: Major
>
> see: [httpcomponents-core/H2RequestContent.java at master · 
> apache/httpcomponents-core 
> (github.com)|https://github.com/apache/httpcomponents-core/blob/master/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/protocol/H2RequestContent.java#L82]
>  
> there 3 things are set, but not the content length.
> (if protocol would be < 2 then super.process() would be called which would 
> set it)
>  
> i know http/2 mode setting the content length is optional.  But some servers 
> seems to really want it. And i think as long as the content-length is known 
> upfront it shouldn't harm to set it right?
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org

Reply via email to