Goodmorning everyone, 使用postan我如图所示发出请求,我得到数据。 我使用相同的调用(至少我假设)写,它返回一个空字符串而不是一个json。 哪里可能是错误?
谢谢大家
var client = new RestClient("http://pp.miosito.it/API/");
var request = new RestRequest("STHQRY", Method.POST);
// request.RequestFormat = DataFormat.Json;
request.AddParameter("TblName", "STSIG$");
var response = client.Execute(request);
var content = response.Content;
答案 0 :(得分:0)
添加参数中提到了查询参数详细信息。请更改以下代码
<强>代码:强>
var client = new RestClient("http://pp.miosito.it/API/");
var request = new RestRequest("STHQRY?TblName=STSIG$", Method.POST);
//Request Body detail needs to be added.
//I assumed input is JSON. Please change the header part , if the body has different
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", body, ParameterType.RequestBody);
var response = client.Execute(request);
var content = response.Content;