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

docs(client): add POST request example to client guide #140

Merged
merged 3 commits into from
Aug 30, 2024

Conversation

akneni
Copy link
Contributor

@akneni akneni commented Aug 18, 2024

Add a new section to the "Getting Started with a Client" guide that demonstrates how to make POST requests using hyper. The new section includes examples for sending plain text, binary data, and JSON in the request body, along with appropriate Content-Type headers.

This addition helps users understand how to construct and send POST requests, complementing the existing GET request example. This addresses issue #3411.

Add a new section to the "Getting Started with a Client" guide that
demonstrates how to make POST requests using hyper. The new section
includes examples for sending plain text, binary data, and JSON in
the request body, along with appropriate Content-Type headers.

This addition helps users understand how to construct and send POST
requests, complementing the existing GET request example.
@seanmonstar
Copy link
Member

Thanks so so much for helping improve the guides! I really do appreciate it. I notice that in the 0.14 client guides, making a POST request was talked about, and it's missing in the 1.0 guides.

However, if you have some availability, I feel it'd be good to plan out a bit more what even should be available in the "client" portion of the guides. As #3411 highlights, there's a basic fetch, and then explaining connectors. What do you think would be a good set of guides under "client"? That we could probably split this work out into a separate page, but follow a logical order to build on a user's learning.

@akneni
Copy link
Contributor Author

akneni commented Aug 21, 2024

Agreed. I can move my docs for the 1.0 post request to "advanced client usage".

Add a new page to the "Getting Started with a Client" guide that
demonstrates how to make POST requests using hyper. The new section
includes examples for sending plain text, binary data, and JSON in
the request body, along with appropriate Content-Type headers.

This addition helps users understand how to construct and send POST
requests, complementing the existing GET request example.
@akneni
Copy link
Contributor Author

akneni commented Aug 26, 2024

@seanmonstar Do you have any comments on the updated version of this PR?

Copy link
Member

@seanmonstar seanmonstar left a comment

Choose a reason for hiding this comment

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

I like the list of changes to prep the reader! I think we can merge this, the only comment I have now is regarding the name of the guide, since changing it can affect the URL. I know it was called "advanced" before, but I think the name could be improved. There's two options that come to my mind:

  1. /client/post/
  2. /client/send-data/

The first one might closer match the terminology someone is thinking off, where the second uses more natural English. I'm open to either, and would appreciate hearing a reason for why one is better than the other.

After that, we can merge 😀

@akneni
Copy link
Contributor Author

akneni commented Aug 30, 2024

No problem, I can make that change. I'm thinking /client/post/ may be better. I don't think the "natural English" version is too necessary since anyone working with a low level HTTP library will probably know that a post request sends data.

from `/client/advanced/` to `/client/post/`
@seanmonstar seanmonstar merged commit 1126c63 into hyperium:master Aug 30, 2024
3 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