Hi,
look at ApacheHttpClient and ApacheHttpClientHandler. You can create
Apache client, pass it to handler and use that handler in
com.sun.jersey.client.apache.ApacheHttpClient.
But I think, there is no way to achieve this behavior with
com.sun.jersey.api.client.Client. I think you can create on Jira new
improvement task for this.
Regards,
Petr
2011/2/20 Christopher Piggott <cpiggott_at_gmail.com>:
> Hi,
>
> On Fri, Feb 11, 2011 at 9:59 AM, Petr Jurák <petr.jurak_at_gmail.com> wrote:
>> Ok, I see what you want.
>> So try jersey with apache client:
>>
>> HostConfiguration hostConfiguration = new HostConfiguration();
>> byte b[] = new byte[4];
>> b[0] = new Integer(192).byteValue();
>> b[1] = new Integer(168).byteValue();
>> b[2] = new Integer(1).byteValue();
>> b[3] = new Integer(11).byteValue();
>>
>> hostConfiguration.setLocalAddress(InetAddress.getByAddress(b));
>> HttpClient client = new HttpClient();
>> client.setHostConfiguration(hostConfiguration);
>>
>> Something like that. I hope this help.
>>
>> Regards,
>> Petr
>
> That gets me an HttpClient object, but how do I get from there to a
> jersey client (com.sun.jersey.api.client.Client) ?
>