You can create a simple phoenix app and the router looks like:
pipeline :api do
plug :accepts, ["json", "application/xml"]
end
scope "/odata", WpAdmin.Web do
pipe_through :api
get "/:uri", OdataController, :get
end
I make the request with pacman as follow:
and I’ve got following error:
[info] GET /odata/$metadata
[info] Sent 406 in 811µs
[debug] ** (Phoenix.NotAcceptableError) no supported media type in accept header, expected one of ["json", "application/xml"]
(phoenix) lib/phoenix/controller.ex:1153: Phoenix.Controller.refuse/2
(wp_admin) lib/wp_admin/web/router.ex:12: WpAdmin.Web.Router.api/2
(wp_admin) lib/wp_admin/web/router.ex:1: anonymous fn/1 in WpAdmin.Web.Router.__match_route__/4
(phoenix) lib/phoenix/router.ex:273: Phoenix.Router.__call__/1
(wp_admin) lib/wp_admin/web/endpoint.ex:1: WpAdmin.Web.Endpoint.plug_builder_call/2
(wp_admin) lib/plug/debugger.ex:123: WpAdmin.Web.Endpoint."call (overridable 3)"/2
(wp_admin) lib/wp_admin/web/endpoint.ex:1: WpAdmin.Web.Endpoint.call/2
(plug) lib/plug/adapters/cowboy/handler.ex:15: Plug.Adapters.Cowboy.Handler.upgrade/4
Thanks a lot























