Javaの標準APIでHTTP接続を行う場合、Java 8以前のバージョンでは、HttpURLConnectionクラスを利用する方法が一般的だった。しかし、このクラスはJava SE 1.1の頃(1996年)に追加された非常に古いもので、機能面でも使い勝手の面でも、現在のアプリケーション開発で ...
前回は、Java 11から正式に追加されたHTTPクライアントAPIを使った基本的なHTTP通信のやり方を解説した。 今回も引き続き、いろいろなバリエーションのHTTP通信のやり方を解説する。 前回は、レスポンスボディはHttpResponseインスタンスに対してbody()メソッドを ...
The 1.0 version of the Hypertext Transfer Protocol, issued way back in 1996, only defined three HTTP verbs: GET, POST and HEAD. The most commonly used HTTP method is GET. The purpose of the GET method ...
Java 18's Simple Web Server lets you use a command-line tool or API to host files and more. Here's how it works. One of the handiest new features included in the Java 18 release (March 2022) was the ...