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

Example with POST #58

Merged
merged 4 commits into from
Aug 6, 2018
Merged

Example with POST #58

merged 4 commits into from
Aug 6, 2018

Conversation

ewilligers
Copy link
Collaborator

We now have an example of receiving a POST, and state POST semantics.

resolves #57

@ewilligers ewilligers requested a review from mgiuca August 1, 2018 23:59
index.html Outdated
@@ -158,6 +158,40 @@ <h2>
shared. If the ShareData contains no information for a given member,
the query parameter is omitted.
</p>
<p>
A share target might only be interested in a subset of the ShareData
Copy link
Collaborator

Choose a reason for hiding this comment

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

Linkify ShareData.

index.html Outdated
@@ -158,6 +158,40 @@ <h2>
shared. If the ShareData contains no information for a given member,
the query parameter is omitted.
</p>
<p>
A share target might only be interested in a subset of the ShareData
members.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This example seems to serve a dual purpose. Add: "This example also shows a share target that receives data as a POST request, which should be the case if the request causes an immediate side effect."

index.html Outdated
}
</pre>
<p>
The shared information might be read by a service worker.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Linkify service worker.

Add: ", rather than being sent over the network to the server."

index.html Outdated
event.respondWith((async () =&gt; {
const formData = await event.request.formData();
const link = formData.get('link') || '';
return new Response('Shared link: ' + link);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add a line which simulates storing the data server-side (i.e., a side-effect which is why this is a POST).

saveBookmark(link);

Change 'Shared link:' to 'Bookmark saved:'

@ewilligers
Copy link
Collaborator Author

Made requested changes

Copy link
Collaborator

@mgiuca mgiuca left a comment

Choose a reason for hiding this comment

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

lgtm with some nits.

index.html Outdated
A share target might only be interested in a subset of the ShareData
members.
A share target might only be interested in a subset of the
<a data-cite="!WebShare#dom-sharedata">ShareData</a> members. This
Copy link
Collaborator

Choose a reason for hiding this comment

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

Drop the "!" (which makes this a non-normative reference). Note that the above instance of this, I just fixed this morning (you'll see it if you rebase).

index.html Outdated
@@ -176,7 +179,9 @@ <h2>
}
</pre>
<p>
The shared information might be read by a service worker.
The shared information might be read by a <a data-cite=
"!service-workers-1#service-worker-concept">service worker</a>, rather
Copy link
Collaborator

Choose a reason for hiding this comment

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

Again, make this a non-normative reference (remove the "!"). This one actually matters, since SW isn't referenced anywhere else in this spec, it would add it to the "Non-normative references" reference section instead of "Normative".

Copy link
Member

@marcoscaceres marcoscaceres Aug 6, 2018

Choose a reason for hiding this comment

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

NB: @sidvishnoi is working on fixing this, so if a section is marked or identified as informative, the reference will automatically just be treated non-normative. Then we will just ignore "!".

@ewilligers ewilligers merged commit 70f94a6 into w3c:master Aug 6, 2018
@ewilligers ewilligers deleted the post-example branch August 6, 2018 11:00
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.

Give example with POST and state POST semantics
4 participants