简体   繁体   中英

How to get application/pdf media type from Jersey 2.X

I am using Jersey for the services I am consuming. One of my services is returning application/pdf and I have a method which basically looks for the compatible media type and returns true if it is compatible. I am using MediaType.APPLICATION_OCTET_STREAM_TYPE to support pdf but it is not working. response.getMediaType() gives me application/pdf but there is no such media type in MediaType class.

Not sure how to make this work.

I just found the answer. I used MediaType.WildCard_Type and it is working.

Thanks.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM