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

Stojce Dimski commented on HTTPCLIENT-746:
------------------------------------------

Oleg,

1. Map<String, List<String>> in very clean, concise, elegant way shows to the 
user the very nature of request params...
2. Parameter maps can and will be mainly instanced and 'injected' by the 
frameworks like spring/guice in 'singleton/thread/session' manner which means 
not so frequently and we always speak of java.util.collections objects...
3. Searching the keys and values is a non-problem, what about NameValuePair's ?

Reagrding the cumbersome use I played with the 'ClientFormLogin' and

NameValuePair[] nvps = new NameValuePair[] {
        new BasicNameValuePair("IDToken1", "username"),
        new BasicNameValuePair("IDToken2", "password")
};

becomes

final Map <String, List <String>> formParams = new TreeMap <String, List 
<String>>();
formParams.put("IDToken1", Arrays.asList(new String[] { "username" }));
formParams.put("IDToken2", Arrays.asList(new String[] { "password" }));

but I insist those are just 'ValueObject's and in this form are totaly 
decoupled from httpCore and can be easily exchanged with other parts of the 
application... for example same above mentioned parameter map can be injected 
by spring like this

<util:map id="params1">
        <entry key="IDToken1">
                <util:list>
                        <value>username</value>
                </util:list>
        </entry>
        <entry key="IDToken2">
                <util:list>
                        <value>password</value>
                </util:list>
        </entry>
</util:map>

Cheers,
Stojce


> substitute for URLUtils.java
> ----------------------------
>
>                 Key: HTTPCLIENT-746
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-746
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient
>            Reporter: Stojce Dimski
>            Priority: Minor
>             Fix For: 4.0 Alpha 4
>
>         Attachments: urlEncoded.patch, UrlEncodedUtils.zip
>
>
> I would like to contribute a substitute for existing URLUtils.java... 
> UrlEncodedUtils.java offer utility methods for dealing with 'urlencoded' 
> data. Main difference with existing class is that parameters are Map <String, 
> List <String>> instead of NameValue pairs and lack of third party 
> dependencies...  It's partially covered with tests which I will further 
> extend to cover all methods of this utility class.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to