Expand my Community achievements bar.

SOLVED

How to use "Apache HTTP Components Proxy Configuration" when use HttpClient API

Avatar

Level 2

Hi Experts,

I want to use the proxy settings of AEM6.2 on the Web Console  named "Apache HTTP Components Proxy Configuration" when I use HttpClient API to call a http request, but I don't know how to do it. Of course I can define my individual bundle parameters for proxy, but if the server IP was changed we should change all of the settings about proxy include no Proxy settings.

Thanks a lot.

1 Accepted Solution

Avatar

Correct answer by
Level 9

Hi Kuanqi,

Out of the box http client is fragement, so any bundle using the http api by default inherit the global settings.  So configuring proxy in osgi will work.  Just make sure you do not have another bundle embeding or exposing http api.

Thanks

View solution in original post

3 Replies

Avatar

Level 10

Hi ,

Read the configuration parameters from OSGi service and pass those as the params for HttpClient for creating the client object.

Adobe Experience Manager Help | Invoking Adobe Experience Manager Sling Servlets using Apache HTTP A...

Thanks

Avatar

Correct answer by
Level 9

Hi Kuanqi,

Out of the box http client is fragement, so any bundle using the http api by default inherit the global settings.  So configuring proxy in osgi will work.  Just make sure you do not have another bundle embeding or exposing http api.

Thanks