http « connection « Java Network Q&A

Home
Java Network Q&A
1.API
2.bluetooth
3.Client
4.connection
5.Cookie
6.Development
7.Email
8.File
9.ftp
10.http
11.HttpClient
12.https
13.ip
14.Network
15.OS
16.RMI
17.Security
18.Server
19.Socket
20.tcp
21.UDP
22.url
Java Network Q&A » connection » http 

1. Java HttpURLConnection: Can it cope with duplicate header names?    stackoverflow.com

I am debugging some code in the Selenium-rc proxy server. It seems the culprit is the HttpURLConnection object, whose interface for getting at the HTTP headers does not cope with duplicate ...

2. How to modify the header of a HttpUrlConnection    stackoverflow.com

Im trying to improve the Java Html Document a little but i'm running into problems with the HttpUrlConntion. One thing is that some servers block a request if the user agent ...

3. Java UrlConnection HTTP 1.0    stackoverflow.com

I am trying to download a file from my Java application. But because UrlConnection uses HTTP 1.1 protocol i get a Tranfer Encoding: chunked response in which case i can not ...

4. How to send an HTTP header in java    stackoverflow.com

Is it possible to send a Http header via a URL connection in java? I had this working using sockets, but ran into issues with a firewall which don't seem to ...

5. Java, HttpUrlConnection. Problem with getResponseCode()    stackoverflow.com

I try to create the simplest Simplest WebServer and Client using HTTP. (Please, don't tell me to using Apache HTTPClient). Client: try to PUT some file to Server.

// **PUT**
if(REQUEST.toUpperCase().equals("PUT")) {

  File ...

6. Java, Sockets Connections and HTTP Requests/Responses    stackoverflow.com

In an application I need to use Socket connections as well as Http requests/responses in Java, I have done some work with Tomcat but I think it handles only HTTP requests/responses. I ...

7. Java: HTTP PUT with HttpURLConnection    stackoverflow.com

How do you do do an HTTP PUT? The class I'm using seems to think it is doing a PUT but the endpoint is treating it as if I did a ...

8. httpURLConnection vs apache commons http    stackoverflow.com

I just wanted to know if any of you had any problems using java default HttpURLConnection class. Some kind of bug that made you switch to apache commons. Or is it just ...

9. getRequestProperty("Authorization") always returns null    stackoverflow.com

I am trying to read the authorization header for an HTTP request (because I need to add something to it), but I always get null for the header value. Other headers ...

10. Persistant Http client connections in java    stackoverflow.com

I am trying to write a simple Http client application in Java and am a bit confused by the seemingly different ways to establish Http client connections, and efficiently re-use the ...

11. Best java lib for http connections?    stackoverflow.com

hi all I'm writing a simple web crawling script that needs to connect to a webpage, follow the 302 redirects automatically, give me the final url from the link and let ...

12. Sending HTTP Header Info with Java UrlConnection    stackoverflow.com

Alright, so I have this bit of code, and when I make the request, I would like to include some HTTP Header info. How would I go about doing that?

public ...

13. HttpConnection package    stackoverflow.com

I want to download the httpConnection class from apache but I cant find a link, also need to know how to import it and where to put the class files when ...

14. URLConnection does not get the charset    stackoverflow.com

I'm using URL.openConnection() to download something from a server. The server says

Content-Type: text/plain; charset=utf-8
But connection.getContentEncoding() returns null. What up?

15. Java - sending HTTP parameters via POST method easily    stackoverflow.com

I am successfully using this code to send HTTP requests with some parameters via GET method

function void sendRequest(String request)
{
    // i.e.: request = "http://example.com/index.php?param1=a&param2=b&param3=c";
    ...

16. Problem using put in HttpURlConnection    stackoverflow.com

I am trying to do a put statement with a partial representation of a xml file from a java client by using a http put statement and passing a String partialXml I ...

17. "Could not open connection" when using org.apache.http.protocol.HttpRequestExecutor.execute?    stackoverflow.com

I'm trying to open a connection:

HttpPost hp = new HttpPost();
HttpParams rp = new BasicHttpParams();
HttpClientConnection hc = new DefaultHttpClientConnection();
HttpContext hctx = new BasicHttpContext();

hp.setURI(new URI(baseUrl + "/login.jsp"));
rp.setParameter("os_username", username);
rp.setParameter("os_password", password);
rp.setParameter("os_destination", "/secure");
hp.setParams(rp);

HttpResponse response = httpexecutor.execute(hp, ...

18. How do I repeatedly read from a HttpURLConnection?    stackoverflow.com

I've written a Java program which scrapes some content from a web page. It retrieves the content by calling the readWebPage method every couple of seconds. The problem I'm having is ...

19. Send HTTP GET headers in Java    stackoverflow.com

I'm interested if it is possible to send HTTP GET headers with Java. Basically I'm working on a Java program that interfaces with a REST-like web-service. To mimic this I've created a ...

20. Code being redirected to mobile site    stackoverflow.com

I am currently getting a webpage using java URL, however it is being redirected to the mobile version of the site. Is there a way to mimic the browser so I get ...

21. Issues unit testing connection to URI    stackoverflow.com

I'm unit testing my Java/Jersey web service and running into an interesting test case. I'm checking the status codes of different URI entries to make sure that incorrect URIs won't ...

22. HttpURLConnection POST, please Help    stackoverflow.com

im trying to post 3 values into 3 textfields within a webpage form. Just want to know maybe what im doing wrong? Please correct me where im wrong. This is the form code

<form ...

23. How to release connection with Apache http client property?    stackoverflow.com

I use Apache http client 4.1 and always close the response InputStream (e.g. by calling EntityUtils.consume(response.getEntity)) after the HttpGet execution. Now I wonder whether the connection is properly released if the HttpGet ...

24. Why can't I set Java http User-Agent?    stackoverflow.com

I tried to set the User Agent for http request like this:

public BufferedReader readURL(String url){
        URL urlcon;
        ...

25. Singleton Connection changes config. Best way to do    stackoverflow.com

I have a Singleton Class to connect to http server. But the user can change the connection Host and Port. What is the best (most correct) way to update my singleton ...

26. Can I override the Host header where using java's HttpUrlConnection class?    stackoverflow.com

I'm using the following code to open a http connection in java:

 URL url = new URL("http://stackoverflow.com");
 HttpURLConnection conn = (HttpURLConnection) url.openConnection();
 conn.setDoOutput(true);
 conn.setRequestMethod("GET");
 conn.setRequestProperty("Host", "Test:8080");
 conn.getOutputStream();
However calling conn.setRequestProperty("Host", "Test:8080") appears ...

27. Causes of Http Service to crash    stackoverflow.com

We have an external system (not under my control) which has a Http Service running on it and we can invoke the service using Java's HttpURLConnection object. Now, for ...

28. granularity of http connection    coderanch.com

29. http posting using "HttpUrlConnection'    coderanch.com

Hi, 1) I tried both GET as well as POST. It did not work. 2) is it possible for a webserver to know wheather a http request received by it has been made from a browser or from an application ? 3) is that a right piece of code for what I am looking for ? Thanks

30. is HTTP is connection oriented    coderanch.com

This is interesting and confusing for a couple reasons. For one, we often talk about web server sessions. The server maintains some state and remembers the user and what they're doing and that sounds a lot like the definition of a connection. The distinction is that web servers build their session stuff on top of the HTTP protocol, and session is ...

32. URLConnection how to find the Http Code    coderanch.com

33. Http Connection Get    coderanch.com

34. socket's http connection    coderanch.com

38. setting http Header using urlconnection    coderanch.com

I have a servlet that recives http header information from a client program. Now I have observed that when I assign a string value (including empty string ) in conn.addRequestProperty(), then the program works good. But, when I assign a null as any header value, then even the next header value displays a null even if I have assigned a value ...

39. Authenticating with http connection ?    coderanch.com

40. Can't get rid of http connection    coderanch.com

Hi All, I am working on posting multiple request to a server using HTTPClient . First i create a HTTPConnection (http://www.innovation.ch/java/HTTPClient/api/HTTPClient/HTTPConnection.html) and then send a post request. For every post thats made the HTTPResponse is read and processed. After i process the Response, i try to stop the connection, but it doesn't seem to work. Although it stops when i don't ...

41. Http Connection stream only sends 2048 bytes    coderanch.com

Hi, i'm having some trouble sending a byte array via http connection stream to servlet, here is my client code: byte[] bytes = ImageByteArray.getByteArrayFromImage(img); System.out.println(bytes.length); // this prints 167096 http = (HttpConnection) Connector.open("http://localhost:8080/Servlet/ImageServlet"); http.setRequestProperty("Content-Type", "multipart/form-data"); // i also tried image/jpg here http.setRequestMethod(HttpConnection.POST); os = http.openOutputStream(); os.write(bytes); and the servlet code: ServletInputStream in = request.getInputStream(); byte[] data = null; int chunkSize = ...

43. Help with (Http)URLConnection!    coderanch.com

Hi I seem to have messed up the understanding of java.net.URLConnection. Objective: I have 2 Webapps running on different servers. I want to transfer control from WebApp1 on Server1 to WebApp2 on Server2. A simple response.sendRedirect(dest) would ideally suffice but since i have a pretty large amount of data to be passed on from WebApp1 to WebApp2, i do not want ...

45. http connection: POST is not working    forums.oracle.com

To be honest, error 500 doesn't really help you much. It just means something went wrong while the request was being processed. So here it means your HTTP call was set up fine, the Axis service you're invoking was found ok and invoked, but something went wrong after that. Could be something wrong with your Axis call, or something wrong in ...

46. like : Listening HTTP connection    forums.oracle.com

47. Server-Client http connection    forums.oracle.com

Hello, I am trying to create a simple server/client application. I have a sample code that demonstrates such an application, but I am unable to open it correctly using eclipse. The code is in folders, and looks like this (xml style) As you can ...

48. Http Connections    forums.oracle.com

49. How to pass objects when using a http connection?    forums.oracle.com

I have a jsp template that i want to call from my class using HTTPConnection. When i call this jsp page i want to pass an object to that jsp. This object would be used in the jsp and then the HTTPConnection returns the end HTML (kind of similiar to how a browser works).. How can i pass the object to ...

50. http connection problem    forums.oracle.com

51. Non-blocking HTTP connection    forums.oracle.com

I have a servlet that utilizes a BufferedReader to retrieve some data over an HttpURLConnection. There are a few negative behaviors I've found: 1) The calls are blocking -- while one thread waits for a response from the remote server, all incoming requests queue up. The remote server is often slow and this causes huge thread congestion on the servlet container. ...

52. Load class not found / Http connection failed    forums.oracle.com

Im trying to run an applet on the remote server and it throws me this error Java Plug-in 1.6.0_01 Using JRE version 1.6.0_01 Java HotSpot(TM) Client VM User home directory = C:\Users\VSAG c: clear console window f: finalize objects on finalization queue g: garbage collect h: display this help message l: dump classloader list m: print memory usage o: trigger logging ...

53. Http Connection time    forums.oracle.com

I am getting a round trip time of 25 seconds on a mobile device(Nokia E70) while the same code gives 4 seconds RTT on an emulator(WTK standard emulator). I captured the packets bing exchanged and found that around 20 secs are taken by arp (who is) packets. Once the connection is established it takes 4 secs to download the data. Are ...

54. Http Connection Optimal solution.    forums.oracle.com

55. http connection failed    forums.oracle.com

someone please help me fix this problem it wont let me on yahoo to play spades i keep getting connetction failed and a red x Ahhh this problem. This problem is Yahoo related. Complain to yahoo. Your error is not a URL failure (as you implied in the other thread) but a ClassNotFound error. So complain to yahoo. Also you should ...

56. Http connection check    forums.oracle.com

when i try to run it, i get [#document: null] in the console, is there any way to check whether the DOMreader is connecting to the website? it should return a value of "This is something". i've tried the HTMLParser project but for longer websites it gave me tags that wern't in the source code! can anyone recomend a reliable and ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.