1

HttpClient 4.0リモートホストから XML を取得するために使用しています。https://user:pwd@www.somesite.comなどの URL を使用すると、ブラウザーでは正常に動作しますが、このスタックトレース (フォロー) で HttpClient では失敗します。助言がありますか?HTTPSリクエストを処理するためにSSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER設定中に使用していますThreadSafeClientConnManager

コード (部分):

final HttpGet get= new HttpGet(url);
final HttpResponse response = this.client.execute(get);
return new BasicResponseHandler().handleResponse(response);

スタックトレース:

01-05 22:34:03.783: ERROR/SearchResults(11565): 
    Failed to process request to URL: 
    https://user:pwd@www.somesite.com/products/foo/meta/xml_proper_encoding.jsp?version=1
01-05 22:34:03.783: ERROR/SearchResults(11565): 
    org.apache.http.client.HttpResponseException: Unauthorized 
4

1 に答える 1

4

この例UsernamePasswordCredentialsのように、URLではなく渡します。

于 2010-01-06T16:41:24.833 に答える