我在为path param编码进行改进而挣扎:
http://localhost:8080/nuxeo/api/v1是我的基本网址。@GET("path/{documentPath}") Call<Document> fetchDocumentByPath(@Path("documentPath") String docPath);default-domain/blablaResponse{protocol=http/1.1, code=400, message=Bad Request, url=http://localhost:8080/nuxeo/api/v1/path/default-domain%2Fblabla}
retrofit2.RequestBuilderTest#getWithEncodedPathParam放在带有以下断言的Request request = buildRequest(Example.class, "po/ng");中,则此测试assertThat(request.url().toString()).isEqualTo("http://example.com/foo/bar/po/ng/");无法工作。出于安全原因,http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-0450. 限制了验证:
,所以我想直接在path参数中发送'/‘,而不是在%2F中编码它。我怎样才能做到这一点?
谢谢!
发布于 2016-03-30 03:27:43
自parent-2.0.0-beta4以来,@Path注释的参数现在已正常工作。
https://stackoverflow.com/questions/36293299
复制相似问题