3

I wanted to save the HTTP Post request in case of network failure/ unavailability so that when network returns I can send it then. I am not sure if its possible, but it will be great if there is a way to do so.

I use MultipartEntity to create the post request to be sent to server.

Thanks

PS: Saving the data of the post request individually would be too much work, I want to cut down on that.

the100rabh
  • 4,077
  • 4
  • 32
  • 40
  • 1
    Save the data instead and create the request from it on demand. – class stacker Apr 29 '13 at 10:43
  • why not just save the contents of the request, so that request object could be created again when the network comes? – gurvinder372 Apr 29 '13 at 10:44
  • 1
    As far as I know there isn't a way to save HttpPost request. You need to save the data and add a broadcastreceiver for network connection and handle the request by yourself. – hardartcore Apr 29 '13 at 10:44

1 Answers1

1

Create a ServerSocket on the local host, send your request there, read all the bytes and save. This will be your serialized request. You can send it later with Socket to the real server.

Evgeniy Dorofeev
  • 133,369
  • 30
  • 199
  • 275