I have a format :xml Grape::API and for a delete request I want to return an empty response.
Everything I try to enter though, true, false, nil, it tries to convert to xml. How would I go about doing this?
Thanks
Use:
delete do
# your code...
body false
end
Usually, you don't. Since blank body is not a valid xml. But if you insist:
module NullXml
def self.to_xml
""
end
end
# grape endpoint
delete "/something" do
# do the deletion
NullXml
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With