Skip to content

[HTTP/2.0][WIP] H2 server documentation - #12655

Merged
jgraham merged 2 commits into
web-platform-tests:masterfrom
dheiberg:dhdavvie/h2-documentation
Aug 24, 2018
Merged

jgraham merged 2 commits into
web-platform-tests:masterfrom
dheiberg:dhdavvie/h2-documentation

Conversation

@dheiberg

Copy link
Copy Markdown
Contributor

I've written some documentation for the majority of the H2ResponseWriter API aswell as a general overview of how the new frame handlers work and how to use them. Still need to cover a few more functions in the API. Otherwise I'm not quite sure what is missing, thoughts?

@jgraham jgraham left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Generally this seems good, just some minor comments.

Comment thread docs/_writing-tests/h2tests.md Outdated
These instructions assume you are already familiar with the testing
infrastructure and know how to write a standard HTTP/1.1 test.

Ontop of the standard `main` handler that the H1 server offers, the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

On top

Comment thread docs/_writing-tests/server-features.md Outdated
The server now has a prototype HTTP/2.0 server which gives you access to
some of the HTTP/2.0 specific functionality. Currently, the server is off
by default and needs to be run using `./wpt serve --h2` in order to enable it.
To find out more about the new Python handlers introduced head over to

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"head over to" seems a little colloquial. I would say something like "The HTTP 2 server supports handlers that work per-frame; these are documented in […]".

Comment thread docs/_writing-tests/h2responsewriter.md Outdated
## Response Writer API ##

##### `write_headers(self, headers, status_code, status_message=None, stream_id=None, last=False):`
Send a HEADER frame that is tracked by the local state machine.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure these one sentence summaries of the two sentence descriptions are adding much.

Comment thread docs/_writing-tests/h2responsewriter.md Outdated
@@ -0,0 +1,113 @@
## Response Writer API ##

##### `write_headers(self, headers, status_code, status_message=None, stream_id=None, last=False):`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This header level seems very low; is there prededent somewhere else in the docs?

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.

As far as I can see, there is no precedent for this kind of API documentation. There are some js API docs but those are mostly showing a block of code and explaining what they do by the looks of it. I can bump it up a level or two?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah, see if that looks better.

@dheiberg
dheiberg force-pushed the dhdavvie/h2-documentation branch 2 times, most recently from 8a82848 to a71343a Compare August 24, 2018 10:42
…l Handler explanation and how to use new functionality
@dheiberg
dheiberg force-pushed the dhdavvie/h2-documentation branch from a71343a to 07bfccc Compare August 24, 2018 10:48
@annevk

annevk commented Aug 24, 2018

Copy link
Copy Markdown
Member

Looks great, thanks!

docs/_writing-tests/h2responsewriter.md should probably have a pointer back to the main API discussion, or maybe be inlined there? An example or two for that section would also be nice.

@dheiberg

Copy link
Copy Markdown
Contributor Author

@annevk do you mean the API discussion that is open on GitHub?

@annevk

annevk commented Aug 24, 2018

Copy link
Copy Markdown
Member

No, I meant to docs/_writing-tests/h2tests.md.

@dheiberg

Copy link
Copy Markdown
Contributor Author

Ahh thought so, just checking :) I think inlining the responsewriter API into h2tests.md would make a lot of sense, @jgraham thoughts?

@jgraham

jgraham commented Aug 24, 2018

Copy link
Copy Markdown
Contributor

Yeah, that could work.

@jgraham
jgraham merged commit 96508b5 into web-platform-tests:master Aug 24, 2018
zcorpan pushed a commit that referenced this pull request Aug 27, 2018
Added documentation for H2ResponseWriter API as well as a more general Handler explanation and how to use new functionality
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants