How to use "Apache HTTP Components Proxy Configuration" when use HttpClient API | Community
Skip to main content
New Participant
October 16, 2017
Solved

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

  • October 16, 2017
  • 3 replies
  • 2073 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by MC_Stuff

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

3 replies

MC_Stuff
MC_StuffAccepted solution
New Participant
October 17, 2017

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

smacdonald2008
New Participant
October 16, 2017

In addition to what Praveen stated - look here at how to use OSGi configuration nodes -- Adobe Experience Manager Help | Reading Adobe Experience Manager OSGi Configuration Values

edubey
New Participant
October 16, 2017

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 APIs

Thanks