hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Anzivino (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HTTPCLIENT-1804) RequestBuilder.post().addParameter has no effect. Need to keep using deprecated method
Date Fri, 20 Jan 2017 09:39:27 GMT
Antonio Anzivino created HTTPCLIENT-1804:
--------------------------------------------

             Summary: RequestBuilder.post().addParameter has no effect. Need to keep using
deprecated method
                 Key: HTTPCLIENT-1804
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1804
             Project: HttpComponents HttpClient
          Issue Type: Bug
          Components: HttpClient (classic)
    Affects Versions: 4.5.2
            Reporter: Antonio Anzivino
            Priority: Critical


I want to perform an automated login request to a certain website using HttpClient.

I did the following

{code}
HttpUriRequest sisterSamlRequest = post(URL_SISTERIF_SAML_ENDPOINT)

                                                                               .addParameter("RelayState",
relayState)
                                                                               .addParameter("SAMLResponse",
samlResponse)

                                                                               .build();
{code}

But it had no effect on the data transmitted to the server.

Instead, if I keep using the deprecated methods, that works great

{code}
sisterSamlRequest.getParams().setParameter("RelayState", relayState).setParameter("SAMLResponse",
samlResponse);
{code}

According to docs (https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/client/methods/RequestBuilder.html#addParameter(java.lang.String,%20java.lang.String))
parameters on POST requests are being added to the entity. Looking at the code, it _looks
like_ it's doing the right job, but in practice it is not.

So that is why I think this is a bug.

Thanks



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message