I am having some trouble getting the response I expect when I try to replace images on a post using a script I wrote.
I tried to replace existing photo attachments on a post via Micropub (spec says “replace all values of the property”) using this process:
- Upload two tiny PNGs via POST /micropub/media (got 202 + Location URLs on my custom domain).
- Create a draft post via Micropub (form-encoded): h=entry, content=…, photo=,
post-status=draft → got 202 + Location for the draft. - Update via Micropub (JSON): action=update, url=, replace: { photo: } → got 200.
- Fetch with q=source → saw both images in content as tags; there was no photo property in the response.
- Try delete: action=update, url=, delete: [‘photo’] → HTTP 500 with generic error page;
q=source still shows both images. - media?q=source shows my uploaded images with sizes:{large} and cdn:{large}, so uploads themselves look fine.
Expected (per W3C Micropub spec)
- replace.photo should replace all existing photo values with the new one.
Actual
- replace.photo appends; photos end up inline in content and both attachments remain.
- delete: [‘photo’] returns 500; cannot remove attachments via Micropub.
Questions
- Is this the intended behavior of Micro.blog’s Micropub implementation for photo?
- Is there a supported way to replace or remove attached photos via Micropub (or another API)?
- If replace is intentionally append-only for photos, can this be documented, or is a fix/workaround planned?
Thanks!