简体   繁体   中英

Is it possible to POST to a host living on a particular IP address using Apache HttpComponents?

We have a clustered and load balanced application, and I'm trying to briefly achieve session stickiness for a single request via Java. The browser is already sticky, but any underlying requests with the HttpComponents client are not. I don't see anything in the HTTP/1.1 specification (reviewing request headers) or for Apache HttpComponents, but maybe I'm missing something.

I did some more research on this, and it is not possible to "force resolve" an ip/host combination because of how DNS works (especially a resolution service with a load balancer behind it). You either have to resolve it by IP or host name, but not both.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM