Top "Httpurlconnection" questions

HttpURLConnection instance is used to make a single request but the underlying network connection to the HTTP server may be transparently shared by other instances.

HTTPURLConnection Doesn't Follow Redirect from HTTP to HTTPS

I can't understand why Java's HttpURLConnection does not follow an HTTP redirect from an HTTP to an HTTPS URL. I …

java redirect https httpurlconnection http-redirect
How to handle cookies in httpUrlConnection using cookieManager

I have a server request that returns multiple cookies, like that: This is how I'm storing these cookies to the …

android cookies httpurlconnection android-cookiemanager
How to handle HTTP authentication using HttpURLConnection?

I'm writing a Java client that POSTs to a HTTP server that requires authentication. I have to support at least …

java authentication httpurlconnection
Read error response body in Java

In Java, this code throws an exception when the HTTP result is 404 range: URL url = new URL("http://stackoverflow.com/…

java http httpurlconnection
Add Header Parameter in Retrofit

I'm trying to call an API which requires me to pass in an API key. My Service call using HttpURLConnection …

android retrofit httpurlconnection
Android download binary file problems

I am having problems downloading a binary file (video) in my app from the internet. In Quicktime, If I download …

java android download httpurlconnection fileoutputstream
HttpURLConnection Invalid HTTP method: PATCH

When I try to use a non-standard HTTP Method like PATCH with URLConnection: HttpURLConnection conn = (HttpURLConnection) new URL("http://example.…

java httpurlconnection
HttpURLConnection java.io.FileNotFoundException

The code below works great if I connect to what seems to be Apache servers, however when I try to …

android download httpurlconnection filenotfoundexception
java.net.SocketTimeoutException: timeout

With OkHttp library, application is facing following SocketTimeoutException issue. If request size is less, then it is working fine(Less …

java android httpurlconnection okhttp3
Android HTTPUrlConnection : how to set post data in http body?

I've already created my HTTPUrlConnection : String postData = "x=val1&y=val2"; URL url = new URL(strURL); HttpURLConnection conn = (HttpURLConnection) …

android httpurlconnection postdata