8
我正在使用jersey API來使用apache Tomcat進行一些REST Web服務。我需要一個以上的參數傳遞給方法,所以我決定用@QueryParam註釋是這樣的:@POST或@PUT使用@QueryParam休息
@GET
@Path("/date")
@Produces(MediaType.APPLICATION_JSON)
public Response getDate(@QueryParam("id") String Id, @QueryParam("inDate") String inDate)
{
...
}
當我這樣稱呼它一切正常。但是當我使用annotaitions @POST或@PUT代替@GET那麼它顯示了一個錯誤:
HTTP Status 405 - Method Not Allowed
message Method Not Allowed
description The specified HTTP method is not allowed for the requested resource (Method Not Allowed).
是否有可能用戶用這個POST或PUT又如何呢?
任何幫助表示讚賞。
太好了,我試過海報插件並且可以正常工作。非常感謝你! – gajo
如果答案有幫助,您可以將其標記爲已接受 – Bozho