简体   繁体   English

Google App Engine端点接受哪种URI格式?

[英]Which URI format google app engine endpoints accepts?

I need call rest api(Post and Put) which is on google app engines endpoints. 我需要在Google App Engine端点上调用rest api(发布和放置)。 The api takes an array of strings as query parameters. api将字符串数组作为查询参数。 I coded this parameter as "param=string1&param=string2&param=string3". 我将此参数编码为“ param = string1&param = string2&param = string3”。 But, google app engine rejects it with error "invalid arguments". 但是,Google App Engine拒绝它,并显示错误“无效参数”。 How to code the URI for array in rest api? 如何在Rest API中为数组编码URI? I couldn't find any documents on google which can solve this. 我在Google上找不到任何可以解决此问题的文档。

I doesn't know anything about Google app engine API endpoints ( in fact I doesn't anything about Google Apps), but ussually, if you're doingsomething more complex that asking for a value, specially if you're using POST and PUT, 9 on 10 times the required format is a JSON body. 我对Google App Engine API端点一无所知(实际上我对Google Apps不了解),但通常来说,如果您要执行的工作比要求值更复杂,尤其是在使用POST和PUT的情况下,JSON主体是10倍于所需格式的9倍。 so probably your post data, will be something like 因此,您的帖子数据可能类似于

var postData = JSON.stringify(['string1','string2', 'string3'])

or maybe 或者可能

var postData = JSON.stringify({"someIdentifier": ['string1','string2', 'string3']})

You'd actually need the specification for the API that you are calling since this question is more common towards http request, rather than Google endpoints. 实际上,您实际上需要调用的API规范,因为该问题在http请求而非Google端点中更为常见。 With that being said, a PUT or POST REST API would generally take some payload in the form of JSON (most likely) or other formats. 话虽这么说,PUT或POST REST API通常会以JSON(最有可能)或其他格式的形式获取一些有效负载。 This would, again, be documented in the specs of the API you are calling. 同样,这将在您调用的API规范中进行记录。

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

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