How to send HTTP request GET/POST in Java
In this article, we will show you a few examples to make HTTP GET/POST requests via the following APIs: Apache HttpClient 4.5.13, OkHttp 4.2.2, Java 11 HttpClient, Java 1.1 HttpURLConnection…
Favourite tutorials for developers
In this article, we will show you a few examples to make HTTP GET/POST requests via the following APIs: Apache HttpClient 4.5.13, OkHttp 4.2.2, Java 11 HttpClient, Java 1.1 HttpURLConnection…
In this article, we will enhance the previous Spring REST Validation Example, by adding Spring Security to perform authentication and authorization for the requested URLs (REST API endpoints). Technologies used…
Spring Boot makes it quick and easy to create a Spring based applications. Spring Boot Tutorials are included Spring MVC or Web application, Spring RESTful web service, Spring WebFlux, Spring…
This article shows you how to use Apache HttpClient to send an HTTP GET/POST requests, JSON, timeout, redirection and some frequent used examples. This article shows you how to use…
The BufferedReader reads characters; while the InputStream is a stream of bytes. The BufferedReader can’t read the InputStream directly; So, we need to use an adapter like InputStreamReader to convert…
This article shows four ways to copy a file in Java: (1) Files.copy (NIO), (2) Apache Commons IO, (3) Guava, (4) Plain Java. In Java 7+, the NIO Files.copy is…
In Java, we can use Files.readAttributes() to get the file metadata or attribute, and then lastModifiedTime() to display the last modified date of a file. For legacy IO, we can…
A collection of Java date and time examples.
In Java, we can use String.contains() to check if a String contains a substring. We can also check the substring by using indexOf().