Skip to content

HttpClient getting started guide - #46

Open
ok2c wants to merge 1 commit into
apache:masterfrom
ok2c:httpclient-getting-started
Open

HttpClient getting started guide#46
ok2c wants to merge 1 commit into
apache:masterfrom
ok2c:httpclient-getting-started

Conversation

@ok2c

@ok2c ok2c commented Aug 23, 2026

Copy link
Copy Markdown
Member

No description provided.

@ok2c
ok2c force-pushed the httpclient-getting-started branch from 9253398 to be3352b Compare August 23, 2026 08:41
@ok2c ok2c changed the title Httpclient getting started HttpClient getting started guide Aug 23, 2026
@ok2c

ok2c commented Aug 23, 2026

Copy link
Copy Markdown
Member Author

@michael-o @arturobernalg @rschmitt @garydgregory Please let me know if you find anything objectionable or wrong. Feel free to correct my English.

Comment thread src/site/markdown/httpcomponents-client-5.7.x/getting-started.md Outdated
Comment thread src/site/markdown/httpcomponents-client-5.7.x/getting-started.md Outdated
Comment thread src/site/markdown/httpcomponents-client-5.7.x/getting-started.md Outdated
Comment thread src/site/markdown/httpcomponents-client-5.7.x/getting-started.md Outdated
Comment thread src/site/markdown/httpcomponents-client-5.7.x/getting-started.md Outdated
Comment thread src/site/markdown/httpcomponents-client-5.7.x/getting-started.md Outdated
Comment thread src/site/markdown/httpcomponents-client-5.7.x/getting-started.md Outdated
Comment thread src/site/markdown/httpcomponents-client-5.7.x/getting-started.md Outdated
Comment thread src/site/markdown/httpcomponents-client-5.7.x/getting-started.md Outdated
Comment thread src/site/markdown/httpcomponents-client-5.7.x/index.md Outdated
Comment thread src/site/markdown/httpcomponents-client-5.7.x/getting-started.md Outdated
Comment thread src/site/markdown/httpcomponents-client-5.7.x/getting-started.md Outdated
execution. The execution context maanged by HttpClient is represented by the
`HttpClientContext` class, which basically acts a holder of various attributes that can
be set prior to request execution, updated in the course of the request execution and
the response processing, and iterragated upon the message exchange completion.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iterragated ??

Comment thread src/site/markdown/httpcomponents-client-5.7.x/index.md Outdated
- Async support for 103 Early Hints via a pluggable
- Optional Observability nodule with Micrometer / OpenTelemetry support for request timers/counters,
- Async support for 103 Early Hints via a pluggable strategy
- Optional Observability nodule with Micrometer / OpenTelemetry support for request

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nodule ??

.build();
// Provide request custom settings
localContext.setRequestConfig(RequestConfig.custom()
.setCookieSpec(CookieSpecs.STANDARD_STRICT)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this shouldn't be setCookieSpec(StandardCookieSpec.STRICT) ??

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arturobernalg Good catch.

import org.apache.http.client.config.CookieSpecs;


public class AsyncHttpClientContextExample {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The async client must be started before request execution; otherwise these examples fail with CancellationException: Request execution cancelled.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arturobernalg Corrected.

@ok2c
ok2c force-pushed the httpclient-getting-started branch from 7b6af3d to f9a3816 Compare August 23, 2026 15:59
@ok2c
ok2c force-pushed the httpclient-getting-started branch from f9a3816 to afd88f3 Compare August 23, 2026 15:59
@ok2c

ok2c commented Aug 23, 2026

Copy link
Copy Markdown
Member Author

Thank you @michael-o and @arturobernalg! Please do another pass.

@michael-o michael-o left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SEveral spots left

Comment thread samples/pom.xml
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>${slf4j.version}</version>
</dependency>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

runtime scope?

return CONN_MANAGER;
}
```
Please note Connection manager and HttpClient instances are made static for simplicity.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note that


* Classic HttpClient

Please note classic request and entity objects are not thread-safe. They must not

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants