[
https://issues.apache.org/jira/browse/HTTPCLIENT-2254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17652208#comment-17652208
]
Michael Osipov commented on HTTPCLIENT-2254:
--------------------------------------------
Both URI and URL are severely broken and do not adhere to RFC 3986. The input
you have created is invalid on the wire. You must percent encode it.
> Allow to use java.net.URL to create any instance of HttpUriRequest
> ------------------------------------------------------------------
>
> Key: HTTPCLIENT-2254
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2254
> Project: HttpComponents HttpClient
> Issue Type: Improvement
> Components: HttpClient (classic)
> Affects Versions: 5.2.1
> Reporter: Artur
> Priority: Major
>
> h3. Context
> We use Apache Http Client v5 to communicate with a bunch of services. So the
> API of a remote service (public, we don't maintain that) in some cases
> requires using uncoded query parameter values and these values can be not
> ASCII.
>
> h3. Example
>
> This is the URL that we have to call
>
> {{https://remote-service/api/directory/c6eb9ba1-a862-4f50-81a3-bf9f3f5cc94c/items?DirRef=path/someParams&Reference=значение
> с кириллицей в имени}}
> Creating an instance of
> {{URI.create("https://remote-service/api/directory/c6eb9ba1-a862-4f50-81a3-bf9f3f5cc94c/items?DirRef=path/someParams&Reference=значение
> с кириллицей в имени"); }}
>
> throws an exception java.net.URISyntaxException
> However, if we use an instance of java.net.URL it allows us to create
>
> {{new
> URL("https://remote-service/api/directory/c6eb9ba1-a862-4f50-81a3-bf9f3f5cc94c/items?DirRef=path/someParams&Reference=значение
> с кириллицей в имени");}}
> h3.
> Suggestion
>
> Could you adjust creating request instances for using java.net.URL class
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]