繁体   English   中英

WebTarget 类型中的方法 request(String...) 不适用于参数 (MediaType)

[英]The method request(String...) in the type WebTarget is not applicable for the arguments (MediaType)

我正在做 Jersey 客户端并在线上收到此错误

String response = target.path("activities/" + id).request(MediaType.APPLICATION_JSON).get(String.class);

Java - 1.8.0.73 / 泽西岛 - 2.22.2

根据文档 - 它应该可以工作,eclipse 显示 3 个重载,但仍然: WebTarget 类型中的方法 request(String...) 不适用于参数 (MediaType)

为什么它看不到其他重载并抛出异常?

导入了错误的 MediaType - org.eclipse.persistence.oxm.MediaType 而不是 javax.ws.rs.core.MediaType

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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