Hi,

Has anyone else experienced an odd behavior with HttpUrlConnection,
using https, a POST request, and image data? I'm in a situation where
the first time I POST my data, everything goes through to the web
server fine. Next time I post, this call:

    HttpURLConnection conn = (HttpURLConnection) new URL
(strUrl).openConnection();

returns immediately, with 'conn' initialized and usable, however no
output is actually written - and the response from the web server is
empty. The result code is -1.

The next time I run the post, everything works fine again. Repeats in
that cycle forever:

 1) post works fine
 2) no good, doesn't actually open connection, and just returns an
empty string.
 3) post works fine
 4) no good, doesn't actually open connection, and just returns an
empty string.
 .. etc ..

this is all from within the same thread, same app - I just made a
dummy activity that has a single button and posts the data to the web
server when clicked.

This is posting to a large 3rd party site. I tried self-signing my own
cert, and pointed to my own test php script on my own server. Same
behavior. Every other post fails like this, no error message /
exception, nothing.

I also ran a proxy (Charles proxy) with the emulator. I can see that
on the failed attempts, no connection is made at all. So it seems like
something is going on inside the android system - a network connection
isn't even attempted. This is a really bizarre problem.

Thanks

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to