| ~~ ==================================================================== |
| ~~ Licensed to the Apache Software Foundation (ASF) under one |
| ~~ or more contributor license agreements. See the NOTICE file |
| ~~ distributed with this work for additional information |
| ~~ regarding copyright ownership. The ASF licenses this file |
| ~~ to you under the Apache License, Version 2.0 (the |
| ~~ "License"); you may not use this file except in compliance |
| ~~ with the License. You may obtain a copy of the License at |
| ~~ |
| ~~ http://www.apache.org/licenses/LICENSE-2.0 |
| ~~ |
| ~~ Unless required by applicable law or agreed to in writing, |
| ~~ software distributed under the License is distributed on an |
| ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| ~~ KIND, either express or implied. See the License for the |
| ~~ specific language governing permissions and limitations |
| ~~ under the License. |
| ~~ ==================================================================== |
| ~~ |
| ~~ This software consists of voluntary contributions made by many |
| ~~ individuals on behalf of the Apache Software Foundation. For more |
| ~~ information on the Apache Software Foundation, please see |
| ~~ <http://www.apache.org/>. |
| |
| ---------- |
| HttpComponents HttpClient Examples |
| ---------- |
| ---------- |
| ---------- |
| |
| HttpClient Examples (Async) |
| |
| * {{{./httpclient5/xref-test/org/apache/hc/client5/http/examples/AsyncClientHttpExchange.html} |
| Asynchronous HTTP exchange}} |
| |
| This example demonstrates a basic asynchronous HTTP request / response exchange. |
| Response content is buffered in memory for simplicity. |
| |
| * {{{./httpclient5/xref-test/org/apache/hc/client5/http/examples/AsyncClientHttpExchangeStreaming.html} |
| Asynchronous HTTP exchange with content streaming}} |
| |
| This example demonstrates an asynchronous HTTP request / response exchange with a full content |
| streaming. |
| |
| * {{{./httpclient5/xref-test/org/apache/hc/client5/http/examples/AsyncClientTlsAlpn.html} |
| HTTP/2 ALPN support}} |
| |
| This example demonstrates how to avoid the illegal reflective access operation warning when running |
| with Oracle JRE 9 or newer. |
| |
| * {{{./httpclient5/xref-test/org/apache/hc/client5/http/examples/AsyncClientHttp1Pipelining.html} |
| Pipelined HTTP/1.1 exchanges}} |
| |
| This example demonstrates a pipelined execution of multiple HTTP/1.1 request / response exchanges. |
| Response content is buffered in memory for simplicity. |
| |
| * {{{./httpclient5/xref-test/org/apache/hc/client5/http/examples/AsyncClientHttp2Multiplexing.html} |
| Multiplexed HTTP/2 exchanges}} |
| |
| This example demonstrates a multiplexed execution of multiple HTTP/2 request / response exchanges. |
| Response content is buffered in memory for simplicity. |
| |
| * {{{./httpclient5/xref-test/org/apache/hc/client5/http/examples/AsyncClientInterceptors.html} |
| Request execution interceptors}} |
| |
| This example demonstrates how to insert custom request interceptor and an execution interceptor to the |
| request execution chain. |
| |
| * {{{./httpclient5/xref-test/org/apache/hc/client5/http/examples/AsyncClientMessageTrailers.html} |
| Message trailers}} |
| |
| This example demonstrates how to use a custom execution interceptor to add trailers to all |
| outgoing request enclosing an entity.. |
| |
| * {{{./httpclient5/xref-test/org/apache/hc/client5/http/examples/AsyncClientHttp2ServerPush.html} |
| Multiplexed HTTP/2 exchanges}} |
| |
| This example demonstrates handling of HTTP/2 message exchanges pushed by the server. |
| |
| * {{{./httpclient5/xref-test/org/apache/hc/client5/http/examples/AsyncClientAuthentication.html} |
| Client authentication}} |
| |
| This example demonstrates execution of an HTTP request against a target site that requires user |
| authentication. |
| |
| * {{{./httpclient5/xref-test/org/apache/hc/client5/http/examples/AsyncClientCustomSSL.html} |
| Custom SSL context}} |
| |
| This example demonstrates how to create secure connections with a custom SSL context. |
| |
| * {{{./httpclient5/xref-test/org/apache/hc/client5/http/examples/AsyncClientConnectionEviction.html} |
| Connection eviction}} |
| |
| This example demonstrates how to evict expired and idle connections from the connection pool. |
| |
| |