步骤一:
Observable<ResultResponse> getMsg(
@Query("content") String content,
);
Observable<ResultResponse> getMsg(
@Query(value = "content", encoded = true) String content,
);
步骤二:
对content进行手动编码:
URLEncoded(content);
public static String URLEncoded(String paramString) {
if (TextUtils.isEmpty(paramString)) {
return "";
}
try {
String str = new String(paramString.getBytes(), "UTF-8");
str = URLEncoder.encode(str, "UTF-8");
return str;
} catch (Exception e) {
e.printStackTrace();
return "";
}
}