[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-981?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12901489#action_12901489
 ] 

Joe Campbell commented on HTTPCLIENT-981:
-----------------------------------------

The HTTP 1.1 spec has items that pertain to both the structure and completeness 
of a Request and a Response - You could Infer that a request was 'good enough' 
for the server to make an interpretation and supply a possible answer to the a 
request - but it would hard than to do something reasonable with the cache 
beyond saying that it should be allowed to cache any 2xx responses that make 
sense.

I have to admit that I am starting to lean in the direction of easing this item 
out of the caching code and tests rather then tying it into the HttpClient 
Protocol processor.  I would love to get Jon's and Dave's opinion on this as 
well.  Jon will be in the office tomorrow and I will mention it to him - Dave 
is here today and I will point him in the direction of this discussion. 

Thanks,
    Joe

> CachingHttpClient returns a 411 respones when executing a POST (HttpPost) 
> request 
> ----------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-981
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-981
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: Cache
>    Affects Versions: 4.1 Alpha2
>            Reporter: Vianney Carel
>             Fix For: 4.1 Alpha3
>
>
> The CachingHttpClient validates requests prior executing them, by calling 
> RequestProtocolCompliance.requestIsFatallyNonCompliant(..).
> When executing an HttpPost, this method considers the request is invalid 
> because it does not contain (yet) a content-length header. Indeed, I observed 
> that this header is generated at the time the DefaultHttpClient fires the 
> request.
> NB: i'm using the Cache 4.1-alpha2 plugged over the HttpClient 4.0.1-final. I 
> can't use the latest version for both because I need to rely on a stable 
> version if there's any. I would be curious to know if we get the same 
> behaviour in 4.1...
> Anyway, I would see two fixes for that issue:
> - make HttpPost set the content-length at the time the entity is set,
> - or remove the validation step on the CachingHttpClient side.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to