Skip to content

Feat: Create resource with PUT instead of POST request method - #164

Open
mrkvon wants to merge 2 commits into
o-development:mainfrom
mrkvon:feat/put-create-resource
Open

Feat: Create resource with PUT instead of POST request method#164
mrkvon wants to merge 2 commits into
o-development:mainfrom
mrkvon:feat/put-create-resource

Conversation

@mrkvon

@mrkvon mrkvon commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

PUT will guarantee the URI of the resource.

We also use HTTP Semantics to ensure an existing resource doesn't get overwritten when we don't want it to.
If-None-Match: * header ensures resource is not overwritten. We then use HTTP status codes 200, 201, 412 to figure out what actually happened. This saves us the one DELETE request before PUT.

https://solidproject.org/TR/protocol#conditional-update
https://www.rfc-editor.org/info/rfc9110/#section-13.1.2, because Solid servers MUST conform to RFC 9110.

The two commits are somewhat independent, so it may be meaningful not to squash them.

The second commit (using HTTP If-None-Match conditional update) is also optional. If it's not desirable, we can get rid of it.

Closes #16

@mrkvon
mrkvon force-pushed the feat/put-create-resource branch from 554de98 to 1436a48 Compare July 16, 2026 20:54

@jaxoncreed jaxoncreed left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread packages/connected-solid/src/requester/requests/uploadResource.ts Outdated
mrkvon added 2 commits July 25, 2026 22:21
PUT will guarantee the URI of the resource.

Closes o-development#16
`If-None-Match: *` header ensures resource is not overwritten.
We then use HTTP status codes 200, 201, 412 to figure out what actually
happened.

https://solidproject.org/TR/protocol#conditional-update
https://www.rfc-editor.org/info/rfc9110/#section-13.1.2
@mrkvon
mrkvon force-pushed the feat/put-create-resource branch from 1436a48 to 58f30df Compare July 25, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use PUT for create resource to guarantee URI

2 participants