简体   繁体   English

如何获取Mosync应用以使用RESTful APi和JSON负载

[英]How to get mosync app to use RESTful APi and json payload

I have written a mosync application that interacts with a REST we service. 我已经编写了一个与我们服务的REST交互的mosync应用程序。 I am using the AMDownload package. 我正在使用AMDownload软件包。 Wat is the right way to send the json payload required by the REST API? Wat是发送REST API所需的json负载的正确方法吗?

The HTTP 400 Bad Request perhaps happens because the MoSync Android runtime messes up the URL, causing the server to return this error. HTTP 400错误请求可能是由于MoSync Android运行时弄乱了URL,导致服务器返回此错误而发生的。 Alternatively, perhaps the MoSync Android runtime considers the URL to be wrong, and sends back the HTTP 400 Bad Request. 另外,MoSync Android运行时可能认为URL错误,然后发回HTTP 400错误请求。

Is it possible for you to test on an Android device? 您可以在Android设备上进行测试吗? To see if the result is the same. 查看结果是否相同。

Also, is it possible to find the exact URL/data sent to the server? 另外,是否可以找到发送到服务器的确切URL /数据? 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? 如果您在Firefox RESTClient之类的客户端中输入相同的请求,是否会得到相同的响应?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM