PUT and POST getting 405 Method Not Allowed Error for Restful Web Services

后端 未结 6 2297
无人及你
无人及你 2020-12-09 18:32

I am trying to set up a simple Restful Web-Service which returns either JSON or XML according to the Accept header. I am using Spring, Maven and WebLogic Server. I took the

6条回答
  •  抹茶落季
    2020-12-09 19:16

    In my case the form (which I cannot modify) was always sending POST.
    While in my Web Service I tried to implement GET method (due to lack of documentation I expected that both are allowed).

    Thus, it was failing as "Not allowed", since there was no method with POST type on my end.

    Changing @GET to @POST above my WS method fixed the issue.

提交回复
热议问题