Skip to content

src/async_impl/request.rs_improved_doc_for_json_fn: - #3082

Merged
seanmonstar merged 1 commit into
seanmonstar:masterfrom
Athleteg:src/async_impl/request.rs_improved_doc_for_json_fn
Aug 10, 2026
Merged

src/async_impl/request.rs_improved_doc_for_json_fn:#3082
seanmonstar merged 1 commit into
seanmonstar:masterfrom
Athleteg:src/async_impl/request.rs_improved_doc_for_json_fn

Conversation

@Athleteg

@Athleteg Athleteg commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

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 json method adds ContentType header under the hood.

The same idea is used in form method.

Thank you.

Comment thread src/async_impl/request.rs Outdated
/// 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.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about two sentences:

  1. That the value is serialized into JSON bytes and that is sent on the body.
  2. That the content-type header is automatically set to that value, if the header is not already set.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seanmonstar it makes sense. Is that updated version ok?

Serializes the value to JSON and sets resulting bytes as the body.

Sets Content-Type header to application/json unless the header is already set.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

@Athleteg
Athleteg force-pushed the src/async_impl/request.rs_improved_doc_for_json_fn branch from 87db7a2 to 5d82082 Compare August 10, 2026 14:08
 - Improved the description of json method.
@Athleteg
Athleteg force-pushed the src/async_impl/request.rs_improved_doc_for_json_fn branch from 5d82082 to 951f5e9 Compare August 10, 2026 14:15
@seanmonstar
seanmonstar merged commit 9f06fd2 into seanmonstar:master Aug 10, 2026
39 checks passed
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