1
0
Fork 0
mirror of https://github.com/edgurgel/httparrot synced 2025-04-05 16:22:32 -04:00

Merge pull request #31 from idabmat/master

Allow to send accept header with delete request
This commit is contained in:
Eduardo Gurgel 2018-10-31 08:54:39 +13:00 committed by GitHub
commit 8f4b1a4a89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,6 +5,10 @@ defmodule HTTParrot.DeleteHandler do
alias HTTParrot.GeneralRequestInfo alias HTTParrot.GeneralRequestInfo
use HTTParrot.Cowboy, methods: ~w(DELETE) use HTTParrot.Cowboy, methods: ~w(DELETE)
def content_types_provided(req, state) do
{[{{"application", "json", []}, :get_json}], req, state}
end
def delete_resource(req, state) do def delete_resource(req, state) do
{info, req} = GeneralRequestInfo.retrieve(req) {info, req} = GeneralRequestInfo.retrieve(req)
req = :cowboy_req.set_resp_body(response(info), req) req = :cowboy_req.set_resp_body(response(info), req)