HTTP Method is not allowed

430 views
Skip to first unread message

Kurt Weston

unread,
Aug 23, 2022, 7:29:36 AM8/23/22
to api-gateway-users
I have a API gateway which maps to Cloud Run services. Nothing fancy or complex. Postman is attempting to POST a json payload to the API gateway endpoint suffixed with "/api/user". However, I keep getting the below message:

{
    "message": "The current request is matched to the defined url template \"/api/user\" but its http method is not allowed",
    "code": 405
}

My yaml sample is:
"/api/user":
    post:
        summary: Create a user
        operationId: create_user
        x-google-backend:
           address: https://{service-path}/api/user
        responses:
            "200":
                description: A successful response
                    schema:
                    type: string

Kurt Weston

unread,
Aug 29, 2022, 6:10:32 AM8/29/22
to api-gateway-users
Weirdly, in my Postman, I needed to explicitly define https in the url and it started working. I presume the POST HTTP Method has some additional security measures in place.
Reply all
Reply to author
Forward
0 new messages