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

Rename the methods to retrieve outgoing-body from write to body #64

Merged
merged 2 commits into from
Oct 26, 2023

Conversation

pchickey
Copy link
Contributor

@pchickey pchickey commented Oct 24, 2023

Prior to this PR, the outgoing-request and outgoing-response resources have methods write which return result<outgoing-body>.

body is a better name than write - it makes it explicit this is about access to a body resource. The outgoing-body resource itself has a method write which gives the body contents as a stream. Using different names for these closely related but different methods makes their distinction more clear.

Additionally: the docs for outgoing-request.write were incorrect - the returned outgoing-body is not a child of the outgoing-request (or outgoing-response). If we were to enforce a child relationship here, outgoing body streaming (i.e. writing to the body after the request or response has been initiated) would not be possible. The word child had been left in the docs by accident, and this PR removes it and makes the docs for both body methods the same.

Pat Hickey added 2 commits October 24, 2023 15:04
`body` is a better name than `write` - it makes it explicit this is
about access to the body. the `outgoing-body` resource itself has a
method `write` which gives the body contents as a stream. Changing this
method name makes this distinction more clear.

The docs for `outgoing-request.write` were incorrect - the outgoing-body
is not a child of the outgoing-request (or outgoing-response), otherwise
outgoing body streaming (i.e. writing to the body after the request or
response has been initiated) would not be possible.
Copy link
Member

@lukewagner lukewagner left a comment

Choose a reason for hiding this comment

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

lgtm!

@pchickey pchickey merged commit 896dac2 into main Oct 26, 2023
1 check passed
@pchickey pchickey deleted the pch/rename_body_method_body branch October 26, 2023 17:53
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