Jersey: @Consumes doesn't quite work when content-type is not set

后端 未结 3 1199
深忆病人
深忆病人 2020-12-31 08:26

I\'m trying to figure out how @Consumes works here.

I have a simplified resource that looks like the below, and I only want this resource to consume \"application/vn

3条回答
  •  青春惊慌失措
    2020-12-31 08:31

    You should specify the type- for example:

    ClientResponse res =
        service.path("accounts")
            .type("application/vnd.dsu.account+json")
            .post(ClientResponse.class,ent);
    

提交回复
热议问题