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
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
to_xml
method in weird ways. I want to make sure I'm returning the proper response if no records are found.