Reputation: 1
I'm struggling with path param encoding with retrofit:
http://localhost:8080/nuxeo/api/v1
is my base url.I have this Call @GET("path/{documentPath}")
Call<Document> fetchDocumentByPath(@Path("documentPath") String docPath);
As param, I'm setting the following: default-domain/blabla
Response{protocol=http/1.1, code=400, message=Bad Request, url=http://localhost:8080/nuxeo/api/v1/path/default-domain%2Fblabla}
Even if I put encode = true to say "don't encode my parameter, it's already encoded", it's still encoding it.
Moreover, in retrofit, this test retrofit2.RequestBuilderTest#getWithEncodedPathParam
doesn't work if we put Request request = buildRequest(Example.class, "po/ng");
with the following assertion: assertThat(request.url().toString()).isEqualTo("http://example.com/foo/bar/po/ng/");
Tomcat has restricted his URL validation for security reason: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-0450.
So I'd like to send '/' directly in my path parameter without encoding it in %2F. How can I achieve it?
Thank you!
Upvotes: 0
Views: 1346
Reputation: 1
Since parent-2.0.0-beta4
, the parameter of the annotation of @Path
is now working properly.
Upvotes: 0