feat(example): add client 100 Continue with fixed body POST example by heiwais25 · Pull Request #3910 · hyperium/hyper · GitHub
Skip to content

feat(example): add client 100 Continue with fixed body POST example - #3910

Closed
heiwais25 wants to merge 1 commit into
hyperium:masterfrom
heiwais25:master
Closed

feat(example): add client 100 Continue with fixed body POST example#3910
heiwais25 wants to merge 1 commit into
hyperium:masterfrom
heiwais25:master

Conversation

@heiwais25

Copy link
Copy Markdown

Notes

This commit adds a new client example demonstrating HTTP 100 Continue functionality.

Background

Hyper Client originally didn't have support for the HTTP 100 Continue functionality.

As per RFC 7231, the client is expected to wait for the 100 Continue from the server after sending only the header parts.

Following the discussion in #3833, the on_informational hook has been officially exposed, allowing the Hyper client to support 100 Continue functionality based on its usage.

This example aims to help new developers easily implement 100 Continue functionality with the Hyper client. The included server is intended only to provide a complete, working scenario.

Tests

Since it is not easy to test 100 Continue with public APIs, this was tested in the following scenario using the included mock server.

Run mock TCP server:

cargo run --example client_100_continue --features="full" -- --server 8080

Run client:

cargo run --example client_100_continue --features="full" -- http://127.0.0.1:8080

@seanmonstar

Copy link
Copy Markdown
Member

@heiwais25

Copy link
Copy Markdown
Author

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.

2 participants