Skip to content

Clarify when the server will respond with 304

It is currently not very clear to me when the server will return status code 304 in response to a PUT request.

Example:

(1) Retrieve item:

curl --request GET \
  --url https://sshoc-marketplace-api.acdh-dev.oeaw.ac.at/api/tools-services/ef1r3I

which will return:

{
  "id": 63903,
  "category": "tool-or-service",
  "label": "Bread!",
  "version": "",
  "persistentId": "ef1r3I",
  "lastInfoUpdate": "2022-01-26T13:46:53+0000",
  "status": "approved",
  "informationContributor": {
    "id": 1,
    "username": "Administrator",
    "displayName": "Administrator",
    "status": "enabled",
    "registrationDate": "2020-07-27T15:13:06+0000",
    "role": "administrator",
    "email": "administrator@example.com",
    "config": true
  },
  "description": "Bread!",
  "contributors": [],
  "properties": [],
  "externalIds": [],
  "accessibleAt": [],
  "relatedItems": [],
  "media": []
}

Note that the description field has "Bread!".

(2) As contributor, try to change item description via PUT request:

curl --request PUT \
  --url https://sshoc-marketplace-api.acdh-dev.oeaw.ac.at/api/tools-services/ef1r3I \
  --header 'Authorization: ${SSHOC_TOKEN}' \
  --header 'Content-Type: application/json' \
  --data '{
	"label": "Bread!",
	"version": "",
	"description": "Bread! Bread! Bread!",
	"contributors": [],
	"properties": [],
	"externalIds": [],
	"accessibleAt": [],
	"relatedItems": [],
	"media": []
}'

Note that the description field has been changed to "Bread! Bread! Bread!" -- however the server will respond with 304.