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

3.4 Add support for updating posts #14

Open
EdwardHinkle opened this issue Jun 10, 2019 · 0 comments
Open

3.4 Add support for updating posts #14

EdwardHinkle opened this issue Jun 10, 2019 · 0 comments
Assignees
Labels

Comments

@EdwardHinkle
Copy link
Owner

Micropub servers should support updating posts, including adding and removing individual properties as described in this section.

Updating entries is done with a JSON post describing the changes to make.

To update an entry, send "action": "update" and specify the URL of the entry that is being updated using the "url" property. The request must also include a replace, add or delete property (or any combination of these) containing the updates to make.

The values of each property inside the replace, add or delete keys must be an array, even if there is only a single value.

While it is okay to combine add/delete operations in the same request, it only makes sense to do so when they are operating on different property-value combinations. Servers may have undefined behavior if multiple operations of the same property-value combination are sent in an update request.

3.4.1 Replace

Replace all values of the property. If the property does not exist already, it is created.

This will replace the entire entry content with the new text, leaving any other existing property of the post as is.

3.4.2 Add

If there are any existing values for this property, they are not changed, the new values are added. If the property does not exist already, it is created.

Adding a syndication URL

Use case: adding a syndication link to a post after it has been published. For example, when a client supports posting first then syndicating to MyFavoriteSocialNetwork or Wikimedia after the fact, the site needs a way to update the original post with the new syndication URL.

To add syndication URLs, include one or more URLs in the update request.

3.4.3 Remove

If the property exists, remove it. This completely removes the specified property.

For properties with multiple values, such as categories, you can remove individual entries by value. If no values remain, the property is removed.

3.4.4 Response

The server must respond to successful update requests with HTTP 200, 201 or 204. If the update operation caused the URL of the post to change, the server must respond with HTTP 201 and include the new URL in the HTTP Location header. Otherwise, the server must respond with 200 or 204, depending on whether the response body has content. No body is required in the response, but the response may contain a JSON object describing the changes that were made.

@EdwardHinkle EdwardHinkle self-assigned this Jun 10, 2019
@EdwardHinkle EdwardHinkle modified the milestone: 1.0.0 Jun 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant