Java HttpClient - Post with file through Proxy

后端 未结 1 1141
耶瑟儿~
耶瑟儿~ 2021-01-25 14:30

I try calling an external website from my webapplication with a proxy. Furthermore and need to execute a POST Request at this external website.

I\'m using: tomcat7, org.

1条回答
  •  粉色の甜心
    2021-01-25 15:21

    I can think of a few issues that could cause this:

    • Are you sure your https proxy does not require authentication? In that case you would probably need to set the credentials in a context and execute the request using the context and the client.Check this example: http://www.the-swamp.info/blog/java-request-through-proxy/

    • Since you are using an https proxy and requesting an https url (SSL/TLS endpoint security) you may have problems with certificate validation. Check this good explanation for https proxies: Pros and cons of using a Http proxy v/s https proxy?

    0 讨论(0)
提交回复
热议问题