如何将参数传递给 RESTfull webservice 中的 GET 方法

use*_*997 5 java rest android web-services

我必须将UserNamepassword作为参数传递给GET方法进行验证。处理后我需要得到响应。那么如何将值传递给RESTfulwebserviceGET方法?

ole*_*sii 2

要在 HTTP GET 中传递参数,您应该使用?分隔符。例如

https://mywebsite.com/user/login?username=bob&password=123
https://mywebsite.com/user/login?paramname1=value1&paramname2=value2
Run Code Online (Sandbox Code Playgroud)

确保始终https与任何敏感数据一起使用。您可能还需要对用户名和密码进行转义/编码以允许扩展 ASCII。如果您需要支持 UNICODE,您应该考虑使用 POST 请求。