Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我在我的代码中返回响应时,我得到的响应是 406 不可接受。
M 使用 apache wink 1.x、jdk 7、tomcat 7。当类型为“application/json”时,我能够返回一个字符串,但不能像响应一样返回 json 对象
如果标头中没有明确请求,这将返回 Json 响应。
@Produces({"application/json", "application/xml" }) public Response retrieve(){ BookingType booking ; //create booking where BookingType can be a POJO(annotated) or JAXB object. return Response.ok(booking).build(); }