Ruang penulis
SEBUAH JURNAL TENTANG TEKNOLOGI

Belajar hal baru.
Tulis. Bagikan.

Ruang untuk merangkai pengetahuan, satu baris kode setiap hari.
Temukan tutorial, ide, dan catatan dari perjalanan belajar.

1914 catatan & terus bertumbuh
PILIHAN EDITOR
Java

Memahami Java Stream: olah koleksi dengan lebih ringkas

Pelajari alur filter, map, dan collect untuk mengolah data Java dengan kode yang mudah dibaca.

D Tim Diary Coding · 1 menit baca
UNTUK RASA INGIN TAHUMU

Catatan terbaru.

HTTPCLIENT / CATATAN</>
HttpClient23 Mei 2025

How do I handle errors and exceptions in Java 11 HttpClient?

In Java 11, the HttpClient API provides a flexible way to handle HTTP requests and responses. When dealing with errors and exceptions, there are several strategies and patterns you can use to ensure your application can handle unexpected issues effectively while making HTTP calls. 1. Exception Types in Java 11 HttpClient Here are some common […]

Wayan · 5 menit baca
HTTPCLIENT / CATATAN</>
HttpClient22 Mei 2025

How do I chain asynchronous calls using Java 11 HttpClient and CompletableFuture?

Chaining asynchronous calls using Java 11’s HttpClient and CompletableFuture can be achieved by leveraging the reactive capabilities of CompletableFuture. The sendAsync method of HttpClient supports asynchronous processing, and you can chain multiple calls together using methods like thenApply, thenCompose, or thenAccept. Here’s a step-by-step example: Key Concepts Used: CompletableFuture: Allows for async processing and chaining […]

Wayan · 3 menit baca
HTTPCLIENT / CATATAN</>
HttpClient22 Mei 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 menit baca
HTTPCLIENT / CATATAN</>
HttpClient21 Mei 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 menit baca
HTTPCLIENT / CATATAN</>
HttpClient21 Mei 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 menit baca
HTTPCLIENT / CATATAN</>
HttpClient20 Mei 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 menit baca

Pengetahuan tumbuh ketika dibagikan.

Simpan rasa ingin tahu. Selalu ada hal baru untuk dipelajari.

Jelajahi catatan ↗
Putu Adi Guna Permana
TENTANG PENULIS

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

Penulis dan pendiri Diary Coding — berbagi catatan, tutorial, dan pengalaman seputar pemrograman untuk siapa pun yang ingin terus belajar.