开发者

REST pass multiple inputs to GET method

开发者 https://www.devze.com 2022-12-25 10:03 出处:网络
I have deployed a simple REST based application in RAD. A simple URL is accessed using http://localhost/<contextroot>/users/<use开发者_C百科rname> where <username> is accessed using

I have deployed a simple REST based application in RAD.

A simple URL is accessed using http://localhost/<contextroot>/users/<use开发者_C百科rname> where <username> is accessed using reqeust.getAttributes(). Now, how do i pass more than one attribute to the REST service?


Usually you'll use query parameters:

http://localhost/<contextroot>/users/<username>?a=10&b=hello

You haven't indicated which language or framework you are using so I can't tell you how to do this in code.


You could also use URLs of the style http://localhost/<contextroot>/comments/<username>/after/<date>, but that tends to get messy if you wish to include a large number of options.

0

精彩评论

暂无评论...
验证码 换一张
取 消