On Mon, 2015-03-23 at 08:59 -0400, Bill Gottlieb wrote:
> It appears that the authorization line must be causing the issue:
>
>
> THIS WORKS:
> 2015/03/23 08:48:05:580 EDT [DEBUG] headers - http-outgoing-0 >>
> Authorization: Basic xxxxxBase64EncodedUserIDAndPasswordxxxxx
> 2015/03/23 08:48:05:580 EDT [DEBUG] headers - http-outgoing-0 >> Host:
> webapi.avertest.com
> 2015/03/23 08:48:05:580 EDT [DEBUG] headers - http-outgoing-0 >>
> Connection: Keep-Alive
> 2015/03/23 08:48:05:580 EDT [DEBUG] headers - http-outgoing-0 >>
> User-Agent: Apache-HttpClient/4.4 (Java 1.5 minimum; Java/1.6.0_45)
> 2015/03/23 08:48:05:580 EDT [DEBUG] headers - http-outgoing-0 >>
> Accept-Encoding: gzip,deflate
> 2015/03/23 08:48:07:929 EDT [DEBUG] headers - http-outgoing-0 << HTTP/1.1
> 200 OK
>
> THIS FAILS (Notice the extra line after the user id password):
> 2015/03/23 05:11:05:491 EDT [DEBUG] headers - http-outgoing-0 >>
> Authorization: Basic xxxxxBase64EncodedUserIDAndPasswordxxxxx
>
> 2015/03/23 05:11:05:491 EDT [DEBUG] headers - http-outgoing-0 >> Host:
> webapi.avertest.com
> 2015/03/23 05:11:05:492 EDT [DEBUG] headers - http-outgoing-0 >>
> Connection: Keep-Alive
> 2015/03/23 05:11:05:492 EDT [DEBUG] headers - http-outgoing-0 >>
> User-Agent: Apache-HttpClient/4.4 (Java 1.5 minimum; Java/1.6.0)
> 2015/03/23 05:11:05:492 EDT [DEBUG] headers - http-outgoing-0 >>
> Accept-Encoding: gzip,deflate
> 2015/03/23 05:11:05:549 EDT [DEBUG] headers - http-outgoing-0 << HTTP/1.1
> 400 Bad Request
>
> Both do the same thing. Why does one get the blank line after the Base64
> encoded info?
>
> import org.apache.commons.codec.binary.Base64;
> ...
> String encoding = base64.encodeBase64String((userID + ":" +
> password).getBytes());
> ....
> HttpGet get = new HttpGet(url);
> get.setHeader("Authorization", "Basic " + encodedAuth);
> ...
>
>
Please see if you have the same version of Commons Codec on both
systems.
Oleg
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]