저는 얼굴 인식 프로젝트를 진행 중이므로 Microsoft Azure인지 서비스와 함께 놀고 있습니다. 내가 6 개월 전에 이것을 못살게 굴 것이라고 생각한 자기 자신의 Json Malformed synax를 교정 할 수없는 이유가 확실치 않습니다. 나는 'Person Group API'를 호출하기 위해 그룹 이름을 만들고 싶다. 그리고 MS 예제를 따라 할 때마다 API 테스트 콘솔에서 오류가 발생하지만 여기서는 MS 사이트에서 빌려온 코드 예제가 없다.Microsoft Face API 1.0 오류 리소스를 찾을 수 없습니다.
{ "error": { "code": "ResourceNotFound", "message": "요청한 리소스를 찾을 수 없습니다." }}
및 콘솔 모드에서 실행되는 코드 :
static async void CreateGroup()
{
string key1 = "YourKey";
// azure the one should work
var client = new HttpClient();
var queryString = HttpUtility.ParseQueryString(string.Empty);
// Request headers
client.DefaultRequestHeaders.Add
("Ocp-Apim-Subscription-Key", key1);
var uri = "https://westus.api.cognitive.microsoft.com/face/v1.0/
persongroups/{personGroupId}?" + queryString;
HttpResponseMessage response;
// Request body
string groupname = "myfriends";
string body = "{\"name\":\"" + groupname + ","+ "\"}";
// Request body
using (var content = new StringContent
(body, Encoding.UTF8, "application/json"))
{
await client.PostAsync(uri, content)
.ContinueWith(async responseTask =>
{
var responseBody = await responseTask.Result
.Content.ReadAsStringAsync();
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("Response: {0}", responseBody);
Console.WriteLine("");
Console.WriteLine("Group Created.... ");
Console.WriteLine("Hit ENTER to exit...");
Console.ReadKey();
});
response = await client.PutAsync(uri, content);
Console.WriteLine("what is this {0}", response.ToString());
Console.ReadKey();
}// end of using statement
}// end of CreateGroup
#endregion
내가 여기 추측이다하지만 난 다시는 내 JSON 잘못된 생각 나는 다시 잘못이 시간에 뭐하는 거지 난 그냥 모르는 , 사이트에 따라 내가 ms로 보내야하는 필드 이름은 'name'입니다. 'userData에'는이
어떤 지원이 가장