go-json-rest-examples icon indicating copy to clipboard operation
go-json-rest-examples copied to clipboard

response 405 Method Not Alllowed

Open benluo opened this issue 9 years ago • 1 comments

local running the program. and local run curl as example.

curl -i -X DELETE http://127.0.0.1:8080/cities/562 HTTP/1.1 405 Method Not Allowed Content-Type: application/json X-Powered-By: go-json-rest Date: Sun, 15 Mar 2015 15:25:32 GMT Content-Length: 35

{ "Error": "Method not allowed" }

GET and POST works well, but PUT does not work same as PUT.

benluo avatar Mar 15 '15 15:03 benluo

Hi,

curl -i -X DELETE is not using the method PUT, it's using DELETE. You should verify that you have a Route defined for each expected method.

Antoine

ant0ine avatar Mar 16 '15 00:03 ant0ine