microsoft / Cognitive-Face-iOS

iOS SDK for the Microsoft Face API, part of Cognitive Services
https://www.microsoft.com/cognitive-services/en-us/face-api
Other
184 stars 64 forks source link

Error Code : 415 Invalid Media Type. #8

Closed rushabh0999 closed 7 years ago

rushabh0999 commented 7 years ago

Hello,

I am using Cognitive Face iOS Api for Face detection and I replace Subscription key in Two files 1) MPOTestConstants.h and 2) MPOAppDelegate.h file when run and demo and click on detection then i get below response from webservice

Get Response :

{ URL: https://api.projectoxford.ai/face/v1.0/detect?returnFaceAttributes=age,facialHair,headPose,smile,gender&returnFaceId=true&returnFaceLandmarks=true } { status code: 415, headers {
    "Cache-Control" = "no-cache";
    "Content-Length" = 64;
    "Content-Type" = "application/json; charset=utf-8";
    Date = "Tue, 18 Oct 2016 06:48:59 GMT";
    Expires = "-1";
    Pragma = "no-cache";
    "X-AspNet-Version" = "4.0.30319";
    "X-Powered-By" = "ASP.NET";
    "apim-request-id" = "ccfcf081-a3e7-4ff2-aef6-5c8d4b9c4b08";
} }

Error :

Error Domain=POFaceServiceClient error - http response is not success : {"error":{"code":"BadArgument","message":"Invalid Media Type."}} Code=415 "The operation couldn’t be completed. (POFaceServiceClient error - http response is not success : {"error":{"code":"BadArgument","message":"Invalid Media Type."}} error 415.)"

huxuan commented 7 years ago

Hi @rushabh0999 , thanks for reporting. The error shows an error related to the image you try to upload. Can you try it on different images? Or if possible, can you provide the image you try to use so that I can reproduce the error?

rushabh0999 commented 7 years ago

Hello huxuan,

Thanks for your quick response I resolved this issue this issue occur due to user location i user the United States User acccount then works fine .

huxuan commented 7 years ago

Hi @rushabh0999, thanks for your update. Can you give more details about the problem and solution. I am curious about the "user location". You mean a different Microsoft account with a different subscription key or a different iCloud/AppStore account with different region? It's really appreciate if you can help us to provide more elegant experience.

rushabh0999 commented 7 years ago

yes i did use different Microsoft account with a different subscription key