In my attempts to create a personal micropub client, I bumped into the oddity that my script posted correctly unless there was a SVG within the post. I use SVG icons regularly in replies (example), bookmarks etc. The feedback I received from others, such as on the issue I filed, tends to always point to trying the same thing with JSON. Though supporting JSON is optional in the Micropub standard, it is supported by the Micropub endpoint in my WordPress site.

Today, I rewrote my basic php script to talk to the Micropub endpoint, and made it submit JSON formatted data. I could not get it to work with curl, which would be the suggested route, but it does work with file_get_contents that also worked earlier without JSON. And now, using JSON, it also works with SVGs in the postings.
While changing tactics doesn’t provide an explanation of why the other route failed, it does allow me to move forward. A working Micropub client is what I now have, so next up is personalising it for my own use cases.

4 reactions on “Personal Micropub Client Now Works With JSON

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.