SupportWriter space ↗
REFERENCE LIBRARY

References from other publishers

Republished articles with source attribution. This collection is separate from Diary Coding’s original guides and does not display ads.

Read original guides → · Editorial policy

FOR YOUR CURIOSITY

Latest notes.

HTTPCLIENT / NOTES</>↗
HttpClient22 May 2025

How do I use Java 11 HttpClient to send asynchronous requests?

In Java 11, the HttpClient API provides a modern and user-friendly way to send both synchronous and asynchronous HTTP requests. To send asynchronous requests, you’ll use the sendAsync method, which returns a CompletableFuture. Here’s how to use it: Step-by-Step Guide to Sending Asynchronous Requests: Initialize the HttpClient: Use HttpClient to create an instance. This is […]

Wayan · 4 min read
HTTPCLIENT / NOTES</>↗
HttpClient21 May 2025

How do I create a reusable HttpClient instance in Java 11?

To create a reusable HttpClient instance in Java 11, you should utilize the HttpClient class introduced in Java 11. This class is designed to handle HTTP requests and responses, and when properly configured, it is optimized for reuse throughout your application. Here’s how: Key Concepts: Thread Safety: HttpClient is immutable and thread-safe. You can create […]

Wayan · 3 min read
HTTPCLIENT / NOTES</>↗
HttpClient21 May 2025

How do I cancel an ongoing HTTP request using Java 11 HttpClient?

In Java 11, the HttpClient API does not provide an explicit “cancel” method for ongoing HTTP requests, but you can use a java.util.concurrent.Future to achieve cancellation. When you send an asynchronous request using HttpClient in Java 11, the sendAsync method returns a CompletableFuture. You can call cancel on the CompletableFuture to attempt to cancel the […]

Wayan · 3 min read
HTTPCLIENT / NOTES</>↗
HttpClient20 May 2025

How do I handle GZIP or compressed responses with Java 11 HttpClient?

Handling GZIP or compressed responses using the Java 11 HttpClient is straightforward. The HttpClient automatically supports GZIP compression, but you need to specify the Accept-Encoding header in the request to indicate that you accept compressed responses, and it will handle decompression automatically if the server responds with compressed data. Here’s how you can do it: […]

Wayan · 2 min read
HTTPCLIENT / NOTES</>↗
HttpClient20 May 2025

How do I use SSL/TLS with Java 11 HttpClient for secure requests?

To use SSL/TLS with Java 11’s HttpClient for secure HTTPS requests, you need to ensure proper configuration of certificates and trust stores. Here’s a detailed step-by-step guide: 1. Default SSL Configuration By default, the Java 11 HttpClient will handle HTTPS requests securely using the system’s default trust store (java.security settings or cacerts trust store in […]

Wayan · 5 min read
HTTPCLIENT / NOTES</>↗
HttpClient19 May 2025

How do I use Java 11 HttpClient with a proxy server?

To use Java 11’s HttpClient with a proxy server, you need to configure the proxy using the ProxySelector class. The ProxySelector allows you to specify a proxy through which HTTP requests should pass. Here’s an example of how you can configure and use HttpClient with a proxy server: Step-by-Step Example Example with Proxy Configuration package […]

Wayan · 4 min read
✳

Knowledge grows when shared.

Stay curious. There is always something new to learn.

Explore notes ↗
Putu Adi Guna Permana
ABOUT THE AUTHOR

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Writer and founder of Diary Coding — sharing notes, tutorials, and experiences about programming for anyone who wants to keep learning.