I'm trying to post data a little bit at a time to a web page. With other words I'm using a loop with an httpConnection, a .setRequestProperty(), a .openDataOutputStream() that writes and flushes, and a .getResponseCode() that always gets HttpConnection.HTTP_OK.
The problem arrives when I post data too often, some data chunks are skipped, even though I wait for the response code. If I put a sleep(1000) after each post it works. So can the web server be not ready even if it has returned a HTTP_OK? Wouldn't the next post fail then, which would not result in HTTP_OK?
I can't figure out why I have to wait if I got an HTTP_OK.