0

I have written a mosync application that interacts with a REST we service. I am using the AMDownload package. Wat is the right way to send the json payload required by the REST API?

user1622343
  • 967
  • 5
  • 9
  • A little bit more information. I am using the setData(MAHandle data) function to set the payload. I have also tried the addPostData function. Both work quite well in the MoRE emulator. However they do not work in the Android emulator. I keep getting Http 400 status errors. Is it the Android emulator that has a problem? – user1622343 Nov 28 '12 at 12:16

1 Answers1

0

The HTTP 400 Bad Request perhaps happens because the MoSync Android runtime messes up the URL, causing the server to return this error. Alternatively, perhaps the MoSync Android runtime considers the URL to be wrong, and sends back the HTTP 400 Bad Request.

Is it possible for you to test on an Android device? To see if the result is the same.

Also, is it possible to find the exact URL/data sent to the server? Perhaps using some network monitor software. If you have access to the server, can you see the request it receives? If you would enter the same request in a client like the Firefox RESTClient, do you get the same response?

Mikael Kindborg
  • 247
  • 2
  • 5