Anyone help with emulating Java URLConnection?
From: Jochen Daum (jochen.daum_at_cabletalk.co.nz)
Date: 04/30/04
- Next message: Jochen Daum: "Re: MDX Query from PHP"
- Previous message: Tom Rogie: "put $_FILES into a session"
- Next in thread: Kelly Thompson: "Re: Anyone help with emulating Java URLConnection?"
- Reply: Kelly Thompson: "Re: Anyone help with emulating Java URLConnection?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 30 Apr 2004 15:04:10 +1200
Hi,
I have to emulate a "file upload" to a Java Servlet which is done with
the class URLConnection.
The java source basically does
URLConnection conn = theurl.openConnection("https://somesite");
w = conn.getOutputStream();
w.write(...)
A thing I'm unclear of is if this connection is actually encrypted
over SSL. The other thing is if this just sends the bytes or also any
HTTP headers
I can think of three possible solutions:
Use fopen:
- I would have to recompile PHP for that and also it says:
"failed to open stream: HTTP wrapper does not support writeable
connections"
Use sockets:
- I have bad experiences with it being unreliable, if you read from
the connection and there are no bytes send. The timeout doesn't seem
to work. Also, I wouldn't know how the SSL would work with that.
Use curl:
- I would expect curl to always send a HTTP header, so I don't know if
its compatible.
Anyone here with Java experience that could help me?
Jochen
-- Jochen Daum - Cabletalk Group Ltd. PHP DB Edit Toolkit -- PHP scripts for building database editing interfaces. http://sourceforge.net/projects/phpdbedittk/
- Next message: Jochen Daum: "Re: MDX Query from PHP"
- Previous message: Tom Rogie: "put $_FILES into a session"
- Next in thread: Kelly Thompson: "Re: Anyone help with emulating Java URLConnection?"
- Reply: Kelly Thompson: "Re: Anyone help with emulating Java URLConnection?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|