I am using Spray Routing to try to match routes using different HTTP method but when I do a GET request it actually goes through DELETE, PUT and GET. I thought delete
and put
rejects all requests that are not HTTP DELETE or HTTP PUT.
This is my basic code:
path(Segment ~ Slash.?) { id =>
delete {
println("Hello from DELETE")
//do stuff for delete
complete("done for DELETE")
} ~
put {
println("Hello from PUT")
//do stuff for put
complete("done for PUT")
} ~
get {
println("Hello from GET")
//do stuff for get
complete("done for GET")
}
}
If I trigger a GET request I can see the app printing:
Hello from DELETE
Hello from PUT
Hello from GET
Am I missing any return call or something?