Skip to content
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

refactor(client): refactor client HTTP1/HTTP2 configuration API #371

Merged
merged 3 commits into from
Jan 26, 2025

Conversation

0x676e67
Copy link
Owner

No description provided.

@0x676e67 0x676e67 merged commit fac8d2d into main Jan 26, 2025
3 checks passed
@0x676e67 0x676e67 deleted the refactor branch January 26, 2025 04:37
@0x676e67
Copy link
Owner Author

This pull request includes significant changes to the rquest library, focusing on refactoring and enhancing the HTTP/1 and HTTP/2 configuration capabilities. The most important changes include the introduction of Http1Builder and Http2Builder structs, updates to the client builder methods, and adjustments to the WebSocketRequestBuilder.

Enhancements to HTTP/1 and HTTP/2 Configuration:

  • examples/impersonate_settings.rs: Added Http1Builder and Http2Builder to the imports and configured the client to use these builders for HTTP/1 and HTTP/2 settings. [1] [2] [3]

  • src/client/http.rs: Updated the ClientBuilder methods to use the new http1 and http2 methods instead of the previous with_http1_builder and with_http2_builder methods. [1] [2] [3] [4] [5]

  • src/util/client/mod.rs: Introduced Http1Builder and Http2Builder structs with Deref and DerefMut implementations, and added corresponding methods in the Builder struct to return these builders. [1] [2] [3]

Codebase Simplification:

  • src/client/http.rs: Simplified the apply_http2_settings function to use Http2Builder directly.

WebSocket Request Builder Adjustments:

  • src/client/websocket/mod.rs: Moved the with_builder method to a different location within the WebSocketRequestBuilder implementation to improve code organization. [1] [2]

Additional Imports and Utility Methods:

  • src/lib.rs: Exported Http1Builder and Http2Builder from the util::client module.
  • src/util/client/mod.rs: Added necessary imports for Deref and DerefMut traits.

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