src/async_impl/request.rs_improved_doc_for_json_fn: - #3082
Merged
seanmonstar merged 1 commit intoAug 10, 2026
Merged
Conversation
seanmonstar
reviewed
Aug 6, 2026
| /// Send a JSON body. | ||
| /// | ||
| /// Sets the body to the JSON byte vector of the passed value, | ||
| /// and also sets the `Content-Type: application/json` header. |
Owner
There was a problem hiding this comment.
How about two sentences:
- That the value is serialized into JSON bytes and that is sent on the body.
- That the content-type header is automatically set to that value, if the header is not already set.
Contributor
Author
There was a problem hiding this comment.
@seanmonstar it makes sense. Is that updated version ok?
Serializes the value to JSON and sets resulting bytes as the body.
Sets
Content-Typeheader toapplication/jsonunless the header is already set.
Athleteg
force-pushed
the
src/async_impl/request.rs_improved_doc_for_json_fn
branch
from
August 10, 2026 14:08
87db7a2 to
5d82082
Compare
- Improved the description of json method.
Athleteg
force-pushed
the
src/async_impl/request.rs_improved_doc_for_json_fn
branch
from
August 10, 2026 14:15
5d82082 to
951f5e9
Compare
seanmonstar
approved these changes
Aug 10, 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.
Dear Team,
That small PR contains just 2 lines of doc improvements.
The idea is simple, whenever we read the doc we can easily see that
jsonmethod addsContentTypeheader under the hood.The same idea is used in
formmethod.Thank you.