-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Pankaj,
On 1/2/2011 10:06 PM, Pankaj Tiwari wrote:
> I have been trying to send multipart/form-data to the server. I have found
> that the request never reaches the server.
How are you checking to see if it reaches the server?
> This is my client code, if I am missing something core in here.
>
> public static void main(String args[])
> {
> try
> {
> URL url = new URL(SERVERURL);
What is SERVERURL?
> con.setDoInput(true);
> con.setDoOutput(true);
...
> OutputStream out = con.getOutputStream();
> DataOutputStream oos = new DataOutputStream(out);
I agree with Pid: why are you using DataOutputStream?
> oos.writeBytes(TWOHYPHENS + BOUNDARY + LINEEND);
Hmm... write before connect?
> oos.flush();
> con.connect();
Try connecting before writing. Also, try reading the response (you did
setDoInput(true)...).
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk0iDnEACgkQ9CaO5/Lv0PD6AQCfctFc2yULc7QkATMx1fAqwe5F
km4AniigJu80/uJ6gl1Kg/6WD1i+rv/I
=KmrY
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]