StatusCode:InternalServerError,内容类型:text / html; charset = utf-8,内容长度:POST请求上的-1

时间:2018-09-07 11:34:46

标签: visual-studio post restsharp

在以下代码下运行时获取内部服务器错误作为响应 代码行-

string URL = "http://test/test/test";

var client = new RestClient(URL);

client.Authenticator =新的NtlmAuthenticator();

var request = new RestRequest(Method.POST); //选择Rest API方法类型

request.AddHeader(“ content-type”,“ application / json”);

request.AddParameter(“ application / json”,“ {'Metadata':[

{'Key':'BatchId','Value':'80720'},'Document':[82]}“,ParameterType.RequestBody);

IRestResponse响应= client.Execute(request);

0 个答案:

没有答案