-
Notifications
You must be signed in to change notification settings - Fork 1
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
Process Content-type properly in REST API when POSTing serialized data #501
Comments
In the meantime, if you want to post a single Event in JOSNLD format, a workaround is to envelop it in a multi-event batch, but containing only that Event. |
I have created branch "issue/501" (see 087df27) where I have a draft of the mentioned new behavior. |
i think the mime type need to be application/json instead of application/ld+json, because the mime refers to the body of request, not of the serialized format of the events. |
As I said, there are 2 types of bodies:
Then there is the special case of multiple Events in batches. The batch envelope is XML or JSON, while the contents are multiple Turtle or JSONLD. Therefore the right Content-type is like the first case: application/xml or application/json, irrespective of the serialized "subcontents" |
In both cases of applicaiton/xml application/json (i.e. envelopes/non-messages and batch messages) I think we need to add a mime type property, not as header, but to distinguish the deserializer to use for each case. The idea is that when sending a publisher (for example), the body is in fact in applicaiton/xml or application/json (specified in http header) provider info's mime type is initially unkown. So that the format of the body should include a property to tell the manager which deserializer to use. The same applies to batch processing. |
Yes, that would be the most "polite" way to do it. As it works now, it tries parsing the "subcontent" as Turtle first, then if it fails it tries JSONLD. Not clean, but it's how it's been working so far. |
There are two types of bodies to POST to REST API:
So...
The text was updated successfully, but these errors were encountered: