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</>↗
HttpClient19 May 2025

How do I use Java 11 HttpClient with basic authentication?

Using Java 11’s HttpClient with Basic Authentication is straightforward. Below is an example of how to configure and send an HTTP request using Basic Authentication: Steps: Encode the Username and Password: Basic Authentication requires the credentials (username and password) to be Base64 encoded in the format username:password. Set the Authorization Header: Attach the Base64 encoded […]

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

How do I upload a file using multipart with Java 11 HttpClient?

To upload a file using the modern HttpClient introduced in Java 11, you can use the multipart/form-data request. The steps involve creating a HttpRequest and sending the file as part of the multipart request body. Below is an example implementation: Example Code: File Upload with Multipart package org.kodejava.net.http; import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import […]

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

How do I send form data using Java 11 HttpClient?

Sending form data using Java 11 HttpClient is fairly straightforward. The HttpClient can be used to send both POST and GET requests, and form data is generally transmitted in POST requests with the application/x-www-form-urlencoded content type. Here’s how you can send form data using Java 11’s HttpClient: Example: Sending Form Data package org.kodejava.net.http; import java.net.URI; […]

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

How do I follow redirects using Java 11 HttpClient?

Java 11 introduced a new HttpClient API in the java.net.http package, making it much easier and more flexible to handle HTTP requests and responses. By default, the HttpClient does not follow redirects automatically. However, you can configure it to follow redirects if required. Here’s how you can configure the HttpClient to follow redirects: Code Example […]

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

How do I use HttpResponse.BodyHandlers to read responses?

To read HTTP responses in Java 11 using HttpResponse.BodyHandlers, you use the Java 11 java.net.http package, which introduced the HttpClient API. The HttpResponse.BodyHandlers class provides various static methods to handle the HTTP response body in different formats, such as strings, files, or byte arrays. Here’s a step-by-step guide to using HttpResponse.BodyHandlers with examples: Step 1: […]

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

How do I use HttpRequest.BodyPublishers in Java effectively?

Java 11 introduced the java.net.http package, providing a modern API to work with HTTP. The HttpRequest.BodyPublishers class is part of this package and is used for sending request bodies when creating HTTP requests using HttpClient. Here’s a breakdown of how to use HttpRequest.BodyPublishers effectively in Java 11: 1. Overview of HttpRequest.BodyPublishers HttpRequest.BodyPublishers is a utility […]

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.