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

Error while using HttpComponentsStreamingClientHttpRequest [SPR-11199] #15825

spring-issuemaster opened this issue Dec 9, 2013 · 2 comments


None yet
2 participants
Copy link

commented Dec 9, 2013

Kaustubh Keshav opened SPR-11199 and commented

I was testing and trying to use the streaming http request via the http components. But I get the below error.

Sample code I used for initialization -

RestTemplate restTemplate = new RestTemplate();
HttpComponentsClientHttpRequestFactory aConnFactory = new HttpComponentsClientHttpRequestFactory();

        List<HttpMessageConverter<?>> messageConverters = new ArrayList<HttpMessageConverter<?>>();

        MappingJackson2HttpMessageConverter aConverter = new MappingJackson2HttpMessageConverter();
FormHttpMessageConverter aHttpMessageConverter = new FormHttpMessageConverter();

Error -

'getBody not supported when bufferRequestBody is false'
	at org.springframework.http.client.HttpComponentsStreamingClientHttpRequest.getBodyInternal(
	at org.springframework.http.client.AbstractClientHttpRequest.getBody(
	at org.springframework.http.converter.FormHttpMessageConverter.writeMultipart(
	at org.springframework.http.converter.FormHttpMessageConverter.write(
	at org.springframework.http.converter.FormHttpMessageConverter.write(
	at org.springframework.web.client.RestTemplate$HttpEntityRequestCallback.doWithRequest(
	at org.springframework.web.client.RestTemplate.doExecute(
	at org.springframework.web.client.RestTemplate.execute(
	at org.springframework.web.client.RestTemplate.postForEntity(

Affects: 4.0 RC2

Reference URL: #312

Issue Links:

  • #17312 All HttpMessageConverters should support StreamingHttpOutputMessage ("duplicates")

2 votes, 4 watchers


This comment has been minimized.

Copy link
Collaborator Author

commented Jun 25, 2015

Brian Clozel commented

A fix for this has been pushed by Arjen Poutsma in #17312.
This is already available in 4.2.0.RC1 - feel free to confirm this fix!


This comment has been minimized.

Copy link
Collaborator Author

commented Jun 25, 2015

Nikita Shmakov commented

Seems this fix works! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.