Does anybody have any ideas on why PUT requests to APIM return 404 “Resource not found” but other operation types return HTTP 200?
I can use the test functionality in the APIM to call the PUT operation endpoints and I can check the console output on back-end web app and see the calls come through. However when using Postman or the a frontend web app we get the resource not found error message.
I'm really confused because, as mentioned, other verbs work fine. We generate the API endpoint definition from Swagger so it's the exact same method that's used to define the other endpoints.
Postman output:
{
"statusCode": 404,
"message": "Resource not found"
}
EDIT: endpoint config
{
"openapi": "3.0.1",
"info": {
"title": "Foo",
"description": "",
"version": "1.0"
},
"servers": [{
"url": "https://custom.domain.com"
}],
"paths": {
"/api/v{version}/Tasks/{taskId}/Complete": {
"put": {
"tags": ["Tasks"],
"summary": "/api/v{version}/Tasks/{taskId}/Complete - PUT",
"operationId": "put-api-v-version-tasks-taskid-complete",
"parameters": [{
"name": "taskId",
"in": "path",
"description": "Format - int64.",
"required": true,
"schema": {
"type": "integer"
}
}, {
"name": "version",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Foo.Tasks.TaskStatusRequest"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Foo.Tasks.TaskStatusRequest"
}
},
"application/*+json": {
"schema": {
"$ref": "#/components/schemas/Foo.Tasks.TaskStatusRequest"
}
}
}
},
"responses": {
"200": {
"description": "Success"
},
"400": {
"description": "Bad Request",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
}
}
}
}
}
}
}
}
}
/api/v{version}/Tasks/{taskId}/Complete
, specifically/api/v1/Tasks/3/Complete
– Damon Stamper