I need to add a body on default destroy method, as a follow: DELETE /path/{id}, body: {}
Googling around, I couldn't find an answer that came close to the solution I need. Has anyone done something similar?
According to the jsonapi standard documentation, this conforms to the spec: https://jsonapi.org/format/.
"Note: RFC 7231 specifies that a DELETE request may include a body, but that a server may reject the request. This spec defines the semantics of a server, and we are defining its semantics for JSON:API."
def destroy(params = {})
self.class.connection.delete(self.class.path + "/#{id}", body: params.to_json)
end
self.class.connection? We need a few more details here or we will be unable to assist.