I have created a separate resource for face detection cognitive service api and it gives the endpoint as follows,
https://southcentralus.api.cognitive.microsoft.com/face/v1.0
so while making request like below,
var byteContent = new ByteArrayContent(fileContents);
byteContent.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");
var response = await _client.PostAsync("detect?returnFaceId=true&returnFaceAttributes=age,gender,smile,facialHair,glasses,headPose,emotion,hair,makeup,occlusion,accessories,blur,exposure,noise", byteContent);
var responseJson = await response.Content.ReadAsStringAsync();
it throws an error saying,
Resource Not Found