CrowdHailer / raxx

Interface for HTTP webservers, frameworks and clients
https://hexdocs.pm/raxx
Apache License 2.0
402 stars 29 forks source link

helper for accepts #88

Closed CrowdHailer closed 5 years ago

CrowdHailer commented 6 years ago

TODO description

similar too https://github.com/phoenixframework/phoenix/blob/d02621e106a9420167e7152f88f0cc4ab57a7785/lib/phoenix/controller.ex#L1065

case accepts(request, :json) do
  {:ok, :json} ->
  {:error, default_response}
end

https://github.com/sinatra/sinatra/blob/180158b725b8a964711ef8bdb3c8cbaf53d2e6a3/test/request_test.rb#L46-L104

https://github.com/rack/rack/blob/8d4c8032c400939bad09d48460c425fee077ee03/lib/rack/utils.rb#L176-L201

https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html