Questions tagged [httpentity]
68 questions
0
votes
1 answer
How to detect if network connection is down while downloading file using InputStream and FileOutputStream in android?
I am downloading a file and then writing it into sdcard using following code:
HttpResponse response = httpClient.execute(request);
HttpEntity entity = response.getEntity();
InputStream is = entity.getContent();
File file = new…

Piscean
- 3,069
- 12
- 47
- 96
0
votes
2 answers
Explain casting of ByteArrayRequestEntity as HttpEntity
I need to set a ByteArrayRequestEntity as the entity on an HttpPost object via the setEntity(...) method which expects an HttpEntity as a parameter. Via the Netbeans tip, I'm casting the ByteArrayRequestEntity as an HttpEntity, but I'm not sure…

macbombe
- 3
- 2
0
votes
0 answers
Android HTTP Response with different language characters
I am working on basic HTTP request response example in Android. For this example project, I tried to work with Google Translate URL. However, the characters of other languages are replaced by junk or hex values in the response. If I hit the URL from…

user3156301
- 45
- 1
- 9
0
votes
0 answers
android-HttpResponse getting error when run on phone
I'm posting data to a php server , it works fine and then i get the response .
When I want to read the response ,it shows me this error
Activity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@2c2a6848 that was originally…

user3579994
- 131
- 1
- 4
- 12
0
votes
1 answer
entity.getContentLength() returns -1
I got BufferedReader object is blank, When I debug my code i found that actually the HttpEntity object is also seems like empty.
Here is my part of code:
// Making HTTP request
try {
// defaultHttpClient
DefaultHttpClient…

Rohit
- 687
- 5
- 22
0
votes
1 answer
Can I consume an entity response after having it initialized GZIPInputStream?
My program is reading this large gzip file and it runs for an hour and so and it fails with the following stack trace:
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:196)
at…

obsessiveCookie
- 1,130
- 2
- 18
- 33
0
votes
1 answer
Cannot get InputStream out of HttpEntity
I have a HttpEntity I received from a web server. If I check that HttpEntity with getContentLength() it shows a value > 0. So there seems to be content. I run getContent() to get an InputStream and on that InputStream I run read() to get the…

AndyAndroid
- 4,039
- 14
- 44
- 71
-1
votes
1 answer
Error on Http.Post.setEntity with MultipartEntityBuilder
I was trying to connect my Android application to my Flask Server on localhost when i had this problem. To do more easy to detect the error i will let you the code of my Android application and the output of the log of Android Studio.
First, the…