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

Add method and content options #112

Closed
wants to merge 1 commit into from

Conversation

shimaore
Copy link
Contributor

This allows for example to support the POST method of CouchDB

This allows for example to support the `POST` method of [CouchDB](http://docs.couchdb.org/en/stable/api/database/changes.html#selector)
@piranna
Copy link
Member

piranna commented Sep 13, 2018

Are they in the spec? Can you point us to it?

@shimaore
Copy link
Contributor Author

As far as I can tell, these would be extensions, just like the headers extension.

@shimaore
Copy link
Contributor Author

To be explicit: the spec doesn't specify which method is used to request the event stream, so any method that returns text/event-stream would be valid in terms of the protocol.

However the API / interface does not seem to allow anything besides GET.

@piranna
Copy link
Member

piranna commented Sep 13, 2018

GET is the default one, so if it's not specified, then it will be GET only.

@aslakhellesoy
Copy link
Contributor

Why would you want to use an EventSource client to issue POST requests? It doesn't look like the CouchDB doc you linked to suggests using EventSource for anything else than consuming server-sent events. The POST part of the API should be used with a standard (non-EventSource) HTTP request (using a http client library such as fetch).

@shimaore
Copy link
Contributor Author

@aslakhellesoy The eventsource feed is data returned by the server, regardless of the method used to request it, the same way that you can get an HTML or a JSON response whether you use GET or POST to request it. In this specific case a selector-type request can only be submitted by using POST, and it will return an event-source stream if requested to do so.

@piranna I understand your viewpoint, thank you for your feedback!

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.

3 participants