簡體   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