feat: convenience function for HEAD requests#8
Merged
Conversation
velocitysystems
suggested changes
Apr 30, 2026
| /// | ||
| /// Returns a [`RequestBuilder`](crate::request::RequestBuilder) that can | ||
| /// be customized with headers, timeout, and retry settings before sending. | ||
| pub fn head(&self, url: impl Into<String>) -> crate::request::RequestBuilder<'_> { |
Contributor
There was a problem hiding this comment.
This calls read_body_with_limit which rejects responses whose advertised Content-Length exceeds max_response_body_size — but for HEAD that's the intended body size, not actual bytes received.
So a head() call against any resource larger than 10 MiB (with the default config) will fail with ResponseTooLarge. This is a pre-existing behavior not introduced with this PR; but worth calling out since it will affect our intended use case for this API method.
Contributor
Author
There was a problem hiding this comment.
@velocitysystems Excellent catch! Fixed.
Adds a convenient Rust function for making HEAD requests. This allows Rust callers to avoid using a Reqwest type needed to call the general `request` function.
2b7cb9c to
33f4d38
Compare
velocitysystems
approved these changes
Apr 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a convenient Rust function for making HEAD requests. This allows Rust callers to avoid using a Reqwest type needed to call the general
requestfunction.