# PUT to create a resource: should the server create a resource or a container?

**URL:** <https://forum.solidproject.org/t/put-to-create-a-resource-should-the-server-create-a-resource-or-a-container/4127>\
**Category:** Interoperability\
**Created:** [March 21, 2021, 7:26pm UTC](https://forum.solidproject.org/t/put-to-create-a-resource-should-the-server-create-a-resource-or-a-container/4127 "2021-03-21T19:26:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vkraus](https://avatars.discourse-cdn.com/v4/letter/v/c5a1d2/32.png) [@vkraus](https://forum.solidproject.org/u/vkraus)\
**Post date:** [March 21, 2021, 7:26pm UTC](https://forum.solidproject.org/t/put-to-create-a-resource-should-the-server-create-a-resource-or-a-container/4127/1 "2021-03-21T19:26:10Z")

</div>

Hello,

[https://solidproject.org/TR/protocol](https://solidproject.org/TR/protocol)

PUT requests can target a non-existent resource. As a server, how do I know if the client wants to create a directory or a resource? Does the Link: header trick from next paragraph applies? If so, why does the next paragraph only mentions POST?

If the Link header trick applies, does that mean that all PUT requests to a container should include it, just in case the target does not exist?

---

<div class="post-metadata">

**Author:** ![Vincent](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@Vincent](https://forum.solidproject.org/u/Vincent)\
**Post date:** [March 21, 2021, 7:56pm UTC](https://forum.solidproject.org/t/put-to-create-a-resource-should-the-server-create-a-resource-or-a-container/4127/2 "2021-03-21T19:56:00Z")

</div>

Hi Vivien, welcome to the forums! I think the relevant section is [3.1 URI Slash Semantics](https://solidproject.org/TR/protocol#uri-slash-semantics):

> Paths ending with a slash denote a container resource.

In other words, if the `PUT` request is to a URL ending in a `/`, the client wants to create a directory, and if it doesn’t, a regular resource.

---

<div class="post-metadata">

**Author:** ![vkraus](https://avatars.discourse-cdn.com/v4/letter/v/c5a1d2/32.png) [@vkraus](https://forum.solidproject.org/u/vkraus)\
**Post date:** [March 21, 2021, 8:01pm UTC](https://forum.solidproject.org/t/put-to-create-a-resource-should-the-server-create-a-resource-or-a-container/4127/3 "2021-03-21T20:01:08Z")

</div>

This is the relevant answer I was looking for. Thank you.
