Sending a Request via Proxy Server

To send requests via a proxy server, use this function.

Signature

Object setProxy(Object connectionInfo, String proxyHost, int proxyPort)

Description

This function updates the HttpConnectionInfo object with the proxy server details.

For secure communication, use the function as follows for both Synchronous and Asynchronous requests:

Object connectionInfo= HTTP.ConnectionInfo.createHTTPConnectionInfo(true);
HTTP.setSecureInfo(Object connectionInfo, String sslProtocol, Object clientIdKeyStore, String clientIdPassword, Object trustedCertsKeystore, String trustedCertsPassword, boolean verifyHostName)
HTTP.setProxy(Object connectionInfo, String proxyHost, int proxyPort)

Parameters

Name Type Description
connectionInfo
Object
HTTP Connection Info object.
proxyHost
String
Proxy host.
proxyPort
Integer
Proxy port.

Returns

Type Description
Object
Connection info object.