apache / apache/openwhisk-apigateway

Invalid method returns 404 not 405

Open
#257 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Lua
Stars
65
Forks
43
PR merge metrics
No merged PRs in 30d

Description

Given an API Gateway set up to only accept GET, if I try to POST to it, I get a `404` back.

I should get a [`405`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405) as the resource exists (i.e. was found), but I'm not allowed to access it with this method.

```
$ wsk api create /hello / GET hello
ok: created API /hello/ GET for action /_/hello
https://service.eu.apiconnect.ibmcloud.com/gws/apigateway/api/d12...b12/hello/

$ curl -I -X POST https://service.eu.apiconnect.ibmcloud.com/gws/apigateway/api/d12..b12/hello
HTTP/1.1 404 Not Found
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS
Access-Control-Allow-Origin: *
Content-Type: application/json; charset=utf-8
Date: Sun, 17 Sep 2017 19:07:37 GMT
Server: openresty
Content-Length: 62

{"status":404,"message":"Error: Whoops. Verb not supported."}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.