我想使用 RestClient gem 通过 POST
请求发送参数(但我不想将参数作为 JSON 传递)。
在 GET
请求中,我会:
url = "http://example.com?param1=foo¶m2=bar"
RestClient.get url
如何在 POST
请求中传递相同的参数而不传递 JSON?
最佳答案
阅读 Rest-client git 的自述文件,它有很多示例显示不同类型的请求。
要得到你的答案,请尝试:
url = "http://example.com"
RestClient.post url,:param1=>foo, :param2=>bar
关于ruby - RestClient post请求中传递参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38788306/