Post #2171772
2026-05-07 16:52 UTC
@evan@cosocial.ca if you want the simplest mechanism to upload media, why bother with multipart request bodies? Just do what I do in BOX->ONI, use a data URI for encoding the binary, either as Object.Content or Object.URL.
Can you tell me what's the difference between a request containing JSON with a data URI property and a multipart request body?
As far as I can tell the binary data is in both cases base64 encoded, so you're not saving on size, it can be malformed for both cases (but for multipart you now you need an extra check to not save the JSON-LD object if the bin-data is broken), etc...
(this suggestion is not entirely serious, but...)
etc...@hongminhee@hollo.social
Replies (2)
-
@evan@cosocial.ca 2026-05-07 17:31
@mariusor@metalhead.club @hongminhee@hollo.social so, what's simplest to me is to keep the structure that was designed 8 years ago. If you would like to propose an alternative, it's incumbent on you to make the case for it. I think what you are describing is fine, btw. It is even compatible with the structure Christine developed. If the media upload gets a POST without a JSON-LD part, just store the contents and return an URL that can be used in a later `Create`.
-
@defnull@chaos.social 2026-05-12 10:44
@mariusor@metalhead.club @evan@cosocial.ca @hongminhee@hollo.social Multipart form data is not base64 encoded and way faster to generate or parse than b64 strings in json.