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
2
votes
1 answer

Understanding the lifecycle of a connection managed by PoolingHttpClientConnectionManager in Apache HTTP client

I felt very confused after reading the Connection Management doc of the Apache HTTP components module, and also a few other resources on connection keep alive strategy and connection eviction policy. There are a bunch of adjectives used in there to…
Ruifeng Ma
  • 2,399
  • 1
  • 22
  • 40
2
votes
2 answers

How to implement maximum 3 try for requesting resource in rest api java

I want to do something like, I should allow user to request for 3 times. After that only it should throw error. I have go through many articles, they said to use something like : for(int i=0;i<3;i++) { try { } catch(Exception e) { …
Neha
  • 109
  • 3
  • 15
2
votes
1 answer

How can I get all cookies from a website using Java

I want to get all cookies from a website using Java In cookie have: _ga _gid PHPSESSID I tried this code, but it just gave only PHPSESSID. CookieManager cookieManager = new CookieManager(); CookieHandler.setDefault(cookieManager); URL url =…
2
votes
0 answers

Connector.open throws IO when using 3g

I'm using the javax microedition Connector class to initialise a HttpConnection. This doesn't work with 3g while it works with wifi. HttpConnection connection = (HttpConnection) Connector.open("http://www.google.com",Connector.READ); I'm trying to…
Vincent
  • 6,058
  • 15
  • 52
  • 94
2
votes
2 answers

How to do proxy tunnelling in java signed applet

how to make persistent connections behind proxy in an applet?** is Using URLConnection will do all the job? I know what i am asking is very general but i am desperate for any ideas. Acording to the article in this link: For HTTP requests, the…
e13420xx
  • 718
  • 1
  • 8
  • 26
2
votes
1 answer

Python: How to mock HTTPSConnection request and response object using json.load

I need to mock below method in my unit test. def get_app_info(role): conn = http.client.HTTPSConnection(url) conn.request( method="GET", url="/v1/profile", headers={ "appName": app["name"], "appRole": role …
Vihaan
  • 31
  • 5
2
votes
0 answers

Post request java http connection 403 forbidden error

I try to send a post request using a java program, I tested the post request URL in postman software, its working fine and post-operation are successful. But when I tried to replicate the same using java program with Http Url connection it pops out…
S Mugunthan kumar
  • 177
  • 1
  • 2
  • 11
2
votes
1 answer

android - send parameters while uploading file

I've got this piece of code http://pastebin.com/VrMNuxcv which successfully uploads a file onto the server from my android. I'd like to , however to be able to send a couple of string parameters together with it. Could you please tell me, if…
kkudi
  • 1,625
  • 4
  • 25
  • 47
2
votes
1 answer

How to wait till HttpURLConnection completes?

If I upload 100K file to certain url of my service, wget takes ~20 seconds to complete: wget --quiet --post-file data.txt --output-document - --header "Content-Type: text/csv" http://localhost:8080/ingest But if I do it like this in java, strangely…
Stepan Yakovenko
  • 8,670
  • 28
  • 113
  • 206
2
votes
1 answer

Requests HTTPConnectionPool Read timeout never recovers

I have a script that runs 24/7 and is sometimes killed by the system-reboot. One portion of the scripts collects bins from pastebin[.]com with certain contents and the other one exports them to remote rest endpoint. The part where I collect bins…
FanaticD
  • 1,416
  • 4
  • 20
  • 36
2
votes
1 answer

NPE in sun.net.www.protocol.http.HttpURLConnection.plainConnect()

I'm working on an application that runs in a JBoss 7 environment and thus is bound to use Java 7 at max (AFAIK JBoss 7 doesn't run on Java 8+ because they did some dirty tricks or used something that changed from Java 7 to 8 (source). The problem…
Thomas
  • 87,414
  • 12
  • 119
  • 157
2
votes
1 answer

Pattern for Single Connection in C#

We would like to use single instance of Http Connection to communicate to server as it's guaranteed to communicate to one end http endpoint Ex: MyConnection.GetRoute.DoStuff() --https://user.site.com/abc/ MyConnection.GetRoute.DoStuff() …
RaceBase
  • 18,428
  • 47
  • 141
  • 202
2
votes
0 answers

HTTPSConnectionPool error

I am trying to scrape data with Python 3.x from particular websites, and for some sites it won't let me scrape and it shows the error like this: raise ConnectionError(e, request=request) requests.exceptions.ConnectionError:…
Bese
  • 66
  • 10
2
votes
1 answer

BlackBerry Dev - Downloading an image from online and displaying

So, I've been through the BlackBerry API, and the online documentation, but I'm having an issue with connecting and getting it to display. I've uploaded the image to the Apache server, and I can access it through localhost, but I can't get it to…
digerati32
  • 623
  • 2
  • 6
  • 17
2
votes
2 answers

BlackBerry OS 6: IOException:"peer refused the connection" on specified url

Calling Connector.open("http://MySpecifiedURL.com;deviceside=true;apn=rim.net.gprs"); Throws IOException: "peer refused the connection". This happens only with few specifies URLs, that used for web services and only on BlackBerry OS 6, on other OS…
shkaffy
  • 71
  • 1
  • 5