Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

heiwais25
Copy link

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

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.

1 participant