Questions tagged [httpentity]
68 questions
113
votes
6 answers
Working POST Multipart Request with Volley and without HttpEntity
This is not really a question, however, I would like to share some of my working code here for your reference when you need.
As we know that HttpEntity is deprecated from API22 and comletely removed since API23. At the moment, we cannot access…

BNK
- 23,994
- 8
- 77
- 87
5
votes
2 answers
How to send multipart request using Volley without HttpEntity?
I am following the solution to send multi-part request using volley from How to multipart data using Android Volley. But, since SDK 22, httpentity is deprecated and it's removed completely on SDK 23.
The solution is to use openConnection, just like…

Spino
- 99
- 1
- 5
4
votes
2 answers
Get the JSON from HttpEntity
I am using akka.http.scaladsl.model.HttpResponse, HttpEntity.
After getting the response , it is of type responseEntity of the format (Content-type: 'application/json', {MyJSONHERE}). Is there a way I can extract my json from the entity.
I tried…

Nagireddy Hanisha
- 1,290
- 4
- 17
- 39
3
votes
1 answer
sending GET request via REST template with JSON request body getting failed with binding binding element must be a struct error?
I am trying to send a GET request using REST Template with a JSON request body, but the request is failing with error,
processing
failedorg.springframework.web.client.HttpServerErrorException$InternalServerError:
500 Internal Server Error:…

Muskan Agarwal
- 378
- 5
- 19
3
votes
0 answers
Upgrading to Spring 5 broke RestTemplate MultipartFile upload
I upgraded from Spring 4.3.16 to Spring 5.0.7. When trying to upload a file using the restTemplate I started to get a "400 - Bad Request". After messing around the only difference in behavior I noticed was removing requestEntity from the exchange…

Joe A
- 300
- 3
- 9
3
votes
0 answers
Premature end of Content-Length delimited message body (expected: 3233986; received: 0)
HttpWithEntity requestEntity = new HttpWithEntity(endPointUrl);
requestEntity.addHeader("Cookie", "session_id=" + session.getSessionId());
requestEntity.setMethod("PUT");
StringEntity rse = new…

Jijesh Kumar
- 299
- 2
- 13
3
votes
2 answers
Get image content from httpResponse in Android
Am trying to get a image from a http response, but am failing to convert the stream to bitmap.
Please let me know, what am i missing here.
FYI - the image content is received as raw binary & its a jpeg image.
Procedure followed:
Make…

Dinesh
- 113
- 2
- 13
2
votes
2 answers
StringEntity/string to HttpEntity
I'm using the loopj library (https://github.com/loopj/android-async-http) and it's recently changed to be compatible with API 23.
When submitting a 'put' request I would pass the StringEntity into the put method like…

Murphybro2
- 2,207
- 1
- 22
- 36
2
votes
1 answer
How to update HttpEntity content?
I have a HttpServletResponse. I'd like to get the content of its entity, change it and then send the response.
Getting the content and changing it is simple : response.getEntity().getContent()
But writing back the modifications into the entity, ...…

yo_haha
- 359
- 1
- 4
- 15
2
votes
0 answers
EntityUtils.toString(entity) is very slow
I am fetching a page with a lot of xml. When I say a lot, I mean a little in terms of computing (~600 KB). For a reason I am unaware of, running EntityUtils.toString(entity) to turn the xml document (httpGet -> URL -> XML) takes about a half hour…

bneigher
- 818
- 4
- 13
- 24
1
vote
1 answer
How to add support for Shallow ETag in ResponseEntity Spring Java
I understand that we can create the filter for Shallow E tag in spring. However, i am looking if there is an easier way to do it.
I am using HttpEntity in my code for getting the response.
The code looks like this
return ResponseEntity.ok()
…

Charu Garg
- 11
- 1
1
vote
1 answer
Test fails as entity is always null
I have this method in my Java application:
public HttpEntity getConfirm(String confirmUrl, String cookie) throws IOException {
LOG.debug("getConfirm triggered");
HttpGet req = null;
try {
HttpClient client =…

runnerpaul
- 5,942
- 8
- 49
- 118
1
vote
1 answer
Sms cannot be Sent via twilio getting 400 error
I am trying to send SMS via Twilio using HttpEntity from my Java code. I am getting 400 Bad Request with no details. The response is below.
[
400 Bad Request
…
400 Bad Request

user3812134
- 11
- 2
1
vote
1 answer
Converting from DescribeSObjectResult to JsonArray (or to HttpEntity)
A couple of weeks ago, I asked a question about reading Salesforce data using the SOAP API instead of the REST API (see Trying to use Apache Gobblin to read Salesforce data using SOAP API(s) instead of REST API ), but unfortunately nobody answered…

Marc K.
- 11
- 4
1
vote
2 answers
BadRequest 400 while trying to call a external API using POST RestTemplate
I have to call an external API in Java Spring in which I have to pass a JSON object as follows( XXX and YYY are parameters ).How can I pass this JSON object using the following classes?
{
"codecConfigId": "XXXXXXXX",
"inputStreams": [{
…

CarlosDv93Dev
- 11
- 1