What is new in Java 11

Java 11 reached General Availability on 25 September 2018, this is a Long Term Support (LTS) version, download Java 11 here or this openJDK archived. Java 11 features. 1. JEP 181: Nest-Based Access Control 2. JEP 309: Dynamic Class-File Constants 3. JEP 315: Improve Aarch64 Intrinsics 4. JEP 318: Epsilon: A No-Op Garbage Collector (Experimental) …

Read more

Apache HttpClient Examples

This article shows you how to use Apache HttpClient to send an HTTP GET/POST requests, JSON, authentication, timeout, redirection and some frequent used examples. P.S Tested with HttpClient 4.5.10 pom.xml <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.5.10</version> </dependency> 1. Send GET Request 1.1 Close manually. HttpClientExample1_1.java package com.mkyong.http; import org.apache.http.HttpEntity; import org.apache.http.HttpHeaders; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.CloseableHttpClient; …

Read more

Java HttpsURLConnection example

Here’s a simple Java HTTPS client to demonstrate the use of HttpsURLConnection class to send a HTTP GET request yo get the https URL content and certificate detail. P.S You may interest at this example – automate login a website with HttpsURLConnection. HttpsClient.java package com.mkyong.client; import java.net.MalformedURLException; import java.net.URL; import java.security.cert.Certificate; import java.io.*; import javax.net.ssl.HttpsURLConnection; …

Read more