java - Simulate form post using http client in Android app? -
Therefore, I am currently preparing an app for a service that includes a Jason-based (unfortunately) Read Only API . There is no problem retrieving the content, however, the only way to post content is using a form on the site that is a location PHP script. This service is open source, so I know what the form should be, but whichever I send, it always results in BAD request .
I caught the network traffic inside my browser and as far as I can see, the browser creates a multipart form request, however, when I copy the request and use it again the client By calling again, the Bad Request is returned.
Is there a way that an APIT request can be prepared in Android, which imitates a form post?
If this is read only I think you will not be able to make a request with POST (This is for editing or adding things).
If you give me advice to you, then I recommend that you use this project as a library.
This makes you deal smoothly with the API, controls network problems, etc.
You can find samples of usage there.
I hope that helps !!!
Comments
Post a Comment