1

I am trying to Get Response from API through Httpclient, but I am getting

org.apache.http.conn.HttpHostConnectException: Connect to URL failed: Connection refused: connect error.

I am able to get the response using PoSTMAN Tool but not through ecclipse when I am accessing through office domain even after setting proxy.

I am using Eclipse. Could you please let me know how to resolve this issue? I am stuck with issue.

Thank you In advance

mentioned the https protocols as well in system properties

java.util.Properties systemProperties = System.getProperties();
systemProperties.put("https.protocols", "TLSv1.2");

Smartsheet smartsheet = new SmartsheetBuilder().setAccessToken(accesstoken).build();
Mikhail Zhuikov
  • 1,213
  • 2
  • 9
  • 19
  • Hi. You are using the Smartsheet Java SDK? What version? You mentioned setting the proxy. Where did you set the proxy? – timwells Oct 14 '19 at 18:38
  • @timwells yes, I am using Java SDK. could you please tell me where to set the proxy in eclipse?. In Chrome I have enabled the proxy. – abdul_hussain Oct 15 '19 at 07:36

1 Answers1

0

With the Smartsheet Java SDK you can implement proxy by overriding the default HTTP client. An example is in the Advanced Topics document here: https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/master/ADVANCED.md#sample-proxyhttpclient

timwells
  • 341
  • 1
  • 4