Java
Chilkat2 Java
HTTPS GET using SSL/TLS
See more HTTP Examples
To retrieve a resource using SSL/TLS (i.e. HTTPS), simply use a URL that begins with "https://". (This applies to any Chilkat HTTP method that has a URL argument, such as QuickGetStr, GetHead, QuickDeleteStr, etc.)Chilkat Java Downloads
import com.chilkatsoft.chilkat2.ChilkatException;
import com.chilkatsoft.chilkat2.Http;
public class ChilkatExample {
public static void main(String[] args) {
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Http http = new Http();
// Send the HTTP GET and return the content in a string.
String html;
try {
html = http.quickGetStr("https://www.chilkatsoft.com/helloWorld.json");
} catch (ChilkatException e) {
System.out.println(e.getLastErrorText());
return;
}
System.out.println(html);
}
}