Question

I have a Dispatch 0.8 DELETE handler that needs to have a body.

So I have a normal DELETE that works fine:

def delete = request.DELETE  ># identity

I tried this:

def delete(body: String) = request.DELETE <<< body ># identity

but it turned the request into a PUT because of the <<< operator.

Was it helpful?

Solution 2

To do this with Dispatch 0.8, I used a sort of hacky solution:

def delete(body: String) = (request << body).DELETE ># identity 

OTHER TIPS

Use setBody instead: "If you wish to supply a string instead of a file, use a setBody method of the RequestBuilder class. Its variants support a number of input types and do not imply a particular HTTP method." from http://dispatch.databinder.net/HTTP+methods+and+parameters.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top