Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Status
colourBlue
titlePOST
 Create a new node at the given path

Create a new child node at the given path, and recursively create any missing parent elements.

Query Parameters:

Status
subtletrue
titlemixin
 (Optional; values: fedora:object, fedora:datastream) Explicitly create an object or datastream, instead of inferring it from the request body 

...

Code Block
curl -X POST "http://localhost:8080/rest/some/path/to/a/new/resource"

Response:

Code Block
Status: 201 Created
 
Headers:
Location: http://localhost:8080/rest/some/path/to/a/new/resource

Example (2):

Code Block
curl -X POST "http://localhost:8080/rest/some/path/to/a/new/resource?mixin=fedora:datastream" # Create a fedora:datastream

...

Status
subtletrue
titlemixin
 (Optional; values: fedora:object, fedora:datastream) Explicitly create an object or datastream, instead of inferring it from the request body 

Example (1):

Code Block
curl -X POST "http://localhost:8080/rest/this/node/already/exists"

Response:

Code Block
Status: 201 Created
 
Headers:
Location: http://localhost:8080/rest/this/node/already/exists/some/generated/identifier

Example (2):

Code Block
curl -X POST -H "Slug: new-node-name" "http://localhost:8080/rest/this/node/already/exists"

Response:

Code Block
Status: 201 Created
 
Headers:
Location: http://localhost:8080/rest/this/node/already/exists/new/-node/-name"


Status:

Status
subtletrue
colourGreen
title201
 Created

...