Questions tagged [httpconnection]

The generic concept of a HTTP connection. May also refer to a concrete HTTPConnection in a specific library, especially the Android HttpConnection

The generic concept of a HTTP connection. May also refer to a concrete HTTPConnection in a specific library, especially the Android HttpConnection.

538 questions
5
votes
1 answer

What is the setAllowUserInteraction() in HttpConnection

How this method setAllowUserInteraction() in HttpConnection works internally? What is the meaning of user interaction in this case ?
Adham
  • 63,550
  • 98
  • 229
  • 344
4
votes
2 answers

"No peer certificate" android application

i'm working on an application for android devices( 2.2). I'm trying to get an html page.The java code I use seems to work, so I can obtain the page I want, but sometimes the app crashes and i get the exception: "no peer certificate". When this…
user1071138
  • 656
  • 3
  • 12
  • 30
4
votes
1 answer

How to close HttpClient? Why there is no .close() method in the API?

I want to use so called "new HttpClient since Java 11" java.net.http.HttpClient. To me, it is very important to make sure that the TCP connection gets closed after an HTTP roundtrip completes, so that corresponding port gets released and resources -…
Giorgi Tsiklauri
  • 9,715
  • 8
  • 45
  • 66
4
votes
0 answers

Http connection Keep Alive with Node js

I would like to write a simple http server for testing my REST API's.I have chosen node js as my programming language to write the server. I have written very simple code. Below is my http server var express = require('express') var app =…
chandan kumar
  • 121
  • 2
  • 6
4
votes
3 answers

httpURLConnection: how long can a post argument be?

I'm currently using something like this: HttpURLConnection con = (HttpURLConnection) u.openConnection (); con.setDoInput(true); con.setRequestMethod("POST"); con.setDoInput (true); con.setDoOutput (true); …
Jason Rogers
  • 19,194
  • 27
  • 79
  • 112
4
votes
1 answer

How to go for refresh token automatically when access token expired and get 401 using HttpURLConnection in android?

I have post request like below, Cant we make it automatic like Retrofit 2.0 interceptor if access token expires get refresh token and service call continues? without interruption? URL url = new URL(myurl + "?access_token=" +…
Supz
  • 145
  • 1
  • 11
4
votes
1 answer

Liferay logout returns 400 response

I am trying to hit the Liferay logout servlet "c/portal/logout" through Java, but it always returns a 400 response: private void sendPost() throws Exception { String url = "localhost:8080/c/portal/logout"; HttpClient client = new…
ravicandy1234
  • 156
  • 1
  • 2
  • 13
4
votes
0 answers

How to stop downloading a file using IntentService in android

I am trying to download the file from app server using the IntentService. It is working fine when i want to download the file completely. but I want to cancel the file downloading in the middle of downloading. but it fails. I have tried to stop the…
Umesh Saraswat
  • 560
  • 1
  • 8
  • 22
4
votes
4 answers

Android http connection - multiple devices cannot connect the same server

I really need help here... I have a simple Android application that connects to my sever to fetch data over HTTPS. Everything is working fine up until i connected to the same server from another device (iOS or Android). I am starting to get…
Oved Yavine
  • 442
  • 6
  • 12
4
votes
2 answers

Send Xml string through POST method in java

I want to pass an xml string through POST method to an URL. I tried below snippet but it doesn't return anything disableCertificateValidation(); String url = "https://..url"; //https Properties sysProps =…
happy
  • 2,550
  • 17
  • 64
  • 109
4
votes
2 answers

Interrupt a long running Jersey Client operation

I am using the Oracle Jersey Client, and am trying to cancel a long running get or put operation. The Client is constructed as: JacksonJsonProvider provider = new JacksonJsonProvider(new ObjectMapper()); ClientConfig clientConfig = new…
Sheldon Warkentin
  • 1,706
  • 2
  • 14
  • 31
4
votes
3 answers

Android: first http response always takes longer (even without keep-alive)

I am using the class HttpUrlConnection for requesting JSON responses I realized that no matter if I set or not System.setProperty("http.keepAlive", "false"); The first response is always going to take longer, while the next responses are very…
Daniele B
  • 19,801
  • 29
  • 115
  • 173
4
votes
1 answer

What is SchemeRegistry in apache and When it should be used?

Apache HTTPClient contains SchemeRegistry class (org.apache.http.conn.scheme.SchemeRegistry) What is Scheme Registry? When can it be used? What impact does it make if i use scheme registry like below SchemeRegistry registry = new…
Prateek
  • 12,014
  • 12
  • 60
  • 81
4
votes
1 answer

program crashing at .connect() on Android, not connecting

I been trying to figure this out for hours now. I've searched for answers, but I can't find an answer. I have never bothered to ask before and this is the first time I'm asking a question. Basically what I am doing is breaking up my coding for…
NERDx
  • 43
  • 1
  • 3
4
votes
3 answers

Is HTTP PUT supported in J2ME?

I just noticed a strange thing in MIDP 2.0 API: The HttpConnection class apidocs make explicit references to methods GET, POST and HEAD, but no other methods. Does this mean that they are not…
hvuoltee
  • 408
  • 4
  • 8
1 2
3
35 36