我正在使用Microsoft Dynamics 365并使用Web API方法访问其数据库。
在这里,考虑它的代码值如下:
Pending: 101
Booked : 102
...
我作为 JSON 数据传递的是:
{
"statuscode":"101"
}
我也试过如下:
"statuscode":101
"statuscode":"Booked"
但它们都不适合我。有人可以指导我吗?
编辑 1:PUT 请求
[ {“状态代码”:101,“状态代码”:0 },{“状态代码”:101,“状态代码”:0 }]
StringBuilder requestURL;
requestURL = new StringBuilder();
requestURL.Append(GenerateRequestURL(entityName));
requestURL.Append("(" + strGuID + ")");
HttpContent content = new StringContent(jsonFormattedData, Encoding.UTF8, "application/json");
Dictionary<string, string> returnValue;
HttpResponseMessage responseMessage;
returnValue = new Dictionary<string, string>();
try
{
HttpClient httpClient = SetUpCRMConnection();
HttpRequestMessage request;
request = new HttpRequestMessage(httpMethod, requestUrl);
request.Content = content;
responseMessage = httpClient.SendAsync(request).Result;
return GetFormattedResponse(responseMessage);
}