[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-2254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17652216#comment-17652216
 ] 

Gary D. Gregory commented on HTTPCLIENT-2254:
---------------------------------------------

This is a case where Java's chosen to be compatible with older versions instead 
of throwing an exception on bad input which bites everyone all the time sadly.

> 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: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org

Reply via email to