-
-
Notifications
You must be signed in to change notification settings - Fork 148
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
I am working on a REST API with SQLPage. I noticed a problem with the use of the DELETE verb. If I do not put a /
character at the end of the URL, I get a 301 Moved Permanently error. I do not have this issue with the other HTTP verbs (GET, PUT, POST, PATCH).
The following code is in the file /api/v1/users/404.sql
.
SELECT 'json' AS component;
SELECT
CASE sqlpage.request_method()
WHEN 'GET' THEN 'READ'
WHEN 'DELETE' THEN 'REMOVE'
END AS value;
You can reproduce the problem with these examples.
GET http://localhost:8080/api/v1/users
###
# Error 301 Moved Permanently ?
DELETE http://localhost:8080/api/v1/users/42
###
# works fine !
DELETE http://localhost:8080/api/v1/users/42/
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working