简体   繁体   中英

Which URI format google app engine endpoints accepts?

I need call rest api(Post and Put) which is on google app engines endpoints. The api takes an array of strings as query parameters. I coded this parameter as "param=string1&param=string2&param=string3". But, google app engine rejects it with error "invalid arguments". How to code the URI for array in rest api? I couldn't find any documents on google which can solve this.

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. 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. 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. This would, again, be documented in the specs of the API you are calling.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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