java - http url 包含数字时出错?

标签 java http retrofit

我正在Java中使用retrofit来发送http请求,

我发送的网址如“account/32/Factivation/34”

我的改造功能是这样的:

@PUT("/tpd/{activeurl}")
Observable<Result<OTPVerificationResponse>> rxputActivation(
        @Path("activeurl") String url
);

当我调试时,我发现,我发送的实际网址是这样的

"account%2F34%2Factivation%2F37"

所以我猜在传递“account/32/Factivation/34”进行改造时会出现错误?

如何解决这个问题?

最佳答案

来自documentation :

Values are URL encoded by default. Disable with encoded=true.

关于java - http url 包含数字时出错?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37220054/

相关文章:

java - UTF-8 字符在 JOptionPane 中不正确

http - 返回 JSONP 的 Restful api 的 Node HTTP 请求

javascript - Angular 的 $http 中返回的 Promise 与普通 Javascript (ES6) 中返回的 Promise 相同吗?

Android:在新线程中使用retrofit时出现NetworkOnMainThreadException?

android - 在 Android 改造中集成简单 XML 转换器时出现的问题

java - 使用 Camel 作为具有 REST 服务的快速后端总线

java - android xml属性android :onClick ="..." work behind the scenes?怎么办

java - Spring boot 2通过Apache Camel连接到rabbitmq

javascript - 同源获取导致空比较(HTTP CORS)

java - 安卓改造 : Can't convert the returned JSON reponse to the specified model class when response code ! = 200