如题:
我对接一个云物联网平台,有一个rest接口是get类型的请求,但是要求在body中传送接json格式的参数
我使用RestSharp,使用request.AddJsonBody但是给我返回一个”ErrorMessage”: “Http verb GET does not support body”,
var client = new RestClient(url);
var request = new RestRequest(Method.GET);
request.Add
今天写了一个接口,需要接收body中的纯文本,但是纯文本不能是json类型,需要是支持text/plain类型的,所以就去搜了一下,后面才知道,需要重新写一个方法。
第一种方法:
public class RawRequestBodyFormatter : IInputFormatter
{
public RawRequestBodyFormatter()
{
}
public bool CanRead(InputFormatterContext context)
{
if