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.

  • Create your own URL
  • Make your URL
  • Tell the component to execute in post mode
  • Create your JSON p> As I told you, I do not even know that it will work.

    I hope that helps !!!

  • Comments

    Popular posts from this blog

    java - ImportError: No module named py4j.java_gateway -

    python - Receiving "KeyError" after decoding json result from url -

    .net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -