Versions Compared

Key

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

...

Methods: GET, POST, PUT, PATCH, HEAD, OPTIONS, DELETE, MOVE, COPY

 

...

Anchorgetget 

Status
titleGET
  Retrieve all triples for the resource

...

Status
subtletrue
colourRed
title404
 Not Found

 

...

Anchorpost 

post
Status
colourBlue
titlePOST
 Create a new automatically-named child node or datastream at the given path

...

Status
subtletrue
colourRed
title409
Conflict (resource is locked or checksum mismatch)

 

...

Anchorput put

Status
colourYellow
titlePUT
  Create a resource with a specified path, or replace the triples associated with a resource with the triples provided in the request body.

...

Example (1): Updating properties with RDF content

Code Block
curl -X PUT -H "Content-Type: text/turtle" --data-binary "@new-triples.rdf" "http://localhost:8080/rest/node/to/update"
 
Request Body:
 
PREFIX dc: <http://purl.org/dc/elements/1.1/>
<> dc:title "some-resource-title" .
 

Response:

Code Block
Status: 204 No Content

 

Example (2): Creating a new resource at a specified path

Code Block
curl -X PUT "http://localhost:8080/rest/node/to/create"

Response:

Code Block
Status: 201 Created

Response Headers:
ETag: "ef214795c3b9109389ffa542a6c081976e1e9587"
Last-Modified: Mon, 19 May 2014 20:52:57 GMT
Location: http://localhost:8080/rest/node/to/create

 

Example (3): Creating new datastream content at a specified path

Code Block
curl -X PUT --upload-file image.jpg "http://localhost:8080/rest/new/datastream/fcr:content"

Response:

Code Block
Status: 201 Created

Response Headers:
ETag: "urn:sha1:ea3d29b28522724a82de042a7b7a4e79a1653435"
Last-Modified: Mon, 19 May 2014 20:55:31 GMT
Location: http://localhost:8080/rest/new/datastream/fcr:content

 

Status:

Status
subtletrue
colourGreen
title204
 No Content

Status
subtletrue
colourRed
title409
Conflict (resource is locked)

Status
subtletrue
colourRed
title412
 Precondition Failed

 

...

Anchorpatchpatch 

Status
colourGreen
titlePATCH
  Modify the triples associated with a resource with SPARQL-Update

...

Status
subtletrue
colourRed
title412
 Precondition Failed

 

...

anchor head

Status
headstatus
colour
Red
titleHEAD
 
Retrieve the node headers
DELETE
Delete a resource

Request Headers:

Lock-Token (Optional) a Lock-Token for any locks previously created on resources updated by this operation

Example:

Code Block
curl -i -X HEADDELETE "http://localhost:8080/rest/node/to/headdelete"

Response:

Code Block
Status: 200 OK
ETag: "bbdd92e395800153a686773f773bcad80a51f47b"
Last-Modified: Wed, 28 May 2014 18:31:36 GMT
Preference-Applied: return=representation; include="http://www.w3.org/ns/ldp#PreferMembership http://www.w3.org/ns/ldp#PreferContainment http://fedora.info/definitions/v4/repository#InboundReferences"

 

204 No Content

 

Status:Status:

Status
subtletrue
colourGreen
title200204
 OK No Content

Status
subtletrue
colourRed
title404
 Not Not Found

 anchor

...


Status
options
subtle
options

...

true
colour

...

Green
title

...

HEAD
 

...

Retrieve the node headers

Example:

Code Block
curl -i -X 

...

HEAD "http://localhost:8080/rest/node/to/

...

head"

Response:

Code Block
Status: 200 OK

...

ETag: 

...

"bbdd92e395800153a686773f773bcad80a51f47b"
Last-Modified: 

...

Wed, 28 May 2014 18:31:36 GMT
Preference-Applied: return=representation; include="http://www.w3.org/ns/ldp#PreferMembership http://www.w3.org/ns/ldp#PreferContainment http://fedora.info/definitions/v4/repository#InboundReferences"

 

Status:

Status
subtletrue
colourGreen
title200
 OK

...

Status

...

subtle

...

Status

true

...

colourRed
title
DELETEDelete a resource

Request Headers:

404
 Not Found

 

...


Status
subtletrue
colourYellow
titleOPTIONS
 Outputs information about the supported HTTP methods, etc. Lock-Token (Optional) a Lock-Token for any locks previously created on resources updated by this operation

Response:

Code Block
Status: 204 No Content

Example:

Code Block
curl -

...

i -X OPTIONS "http://localhost:8080/rest/node/to/options"

Response:

Code Block
Status: 200 OK
Accept-Patch: application/sparql-update
Allow: MOVE,COPY,DELETE,POST,HEAD,GET,PUT,PATCH,OPTIONS
Accept-Post: text/turtle,text/rdf+n3,application/n3,text/n3,application/rdf+xml,application/n-triples,multipart/form-data,application/sparql-update

 

Status:

Status
subtletrue
colourGreen
title

...

200

...

 

...

 OK

 

...



Status
subtletrue
colourRed
titleMOVE
 Move a resource (and its subtree) to a new location

...

Status
subtletrue
colourRed
title502
 Destination URI isn't a valid resource path

 

...

Anchorcopycopy 

Status
subtletrue
colourBlue
titleCOPY
 Copy a resource (and its subtree) to a new location

...