简体   繁体   English

RESTSharp GET 与身体

[英]RESTSharp GET with body

I need to have body element (JSON) with RESTSharp GET call, Although this sounds not correct, I have no other option since third party REST service provider wants me to send GET request but it needs certain parameters in the body,我需要具有 RESTSharp GET 调用的正文元素 (JSON),虽然这听起来不正确,但我没有其他选择,因为第三方 REST 服务提供商希望我发送 GET 请求,但它需要正文中的某些参数,

When I try to user AddBody in RESTSharp request with GET method, it doesn't seem to include the body in final request (when checking with Fiddler)当我尝试使用 GET 方法在 RESTSharp 请求中使用 AddBody 时,它似乎没有在最终请求中包含正文(使用 Fiddler 检查时)

Is there a way to create GET Request with a JSON body?有没有办法用 JSON 主体创建 GET 请求?

I have the same issue.我有同样的问题。 I first tried to change Restsharp source code so that in a GET request it would try to write body part.我首先尝试更改 Restsharp 源代码,以便在 GET 请求中尝试编写正文部分。 But then I got exception "cannot send a content body with this verb type", did another search:但是后来我得到了异常“无法发送具有此动词类型的内容正文”,又进行了一次搜索:

https://stackoverflow.com/a/3981584/2291894 https://stackoverflow.com/a/3981584/2291894

It seems this cannot be realized in .net这似乎无法在 .net 中实现

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

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