$ curl -X GET \
http://127.0.0.1/JSONkeeper/
HTTP/1.0 200 OK
{
"message": "Storing 7 JSON documents. Serving an Activity Stream Collection with 3 CollectionPages at http://127.0.0.1/JSONkeeper/as/collection.json"
}
$ curl -X POST \
-d '{"foo":"bar"}' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
http://127.0.0.1/JSONkeeper/api
HTTP/1.0 201 CREATED
Location: http://127.0.0.1/JSONkeeper/api/e14f58b0-d0ec-4f35-a83b-49c613daa7a3
{"foo":"bar"}
$ curl -X POST \
-d '{"@context": … , "@id": "foo", … }' \
-H 'Accept: application/json' \
-H 'Content-Type: application/ld+json' \
http://127.0.0.1/JSONkeeper/api
HTTP/1.0 201 CREATED
Location: http://127.0.0.1/JSONkeeper/api/b3529667-0949-418d-b3d8-35d64c6d6ec6
{"@context": … , "@id": "http://127.0.0.1/JSONkeeper/api/b3529667-0949-418d-b3d8-35d64c6d6ec6", … }
Note that the Content-Type
is different and the document's @id
gets changed.
$ curl -X GET \
-H 'Accept: application/json' \
http://127.0.0.1/JSONkeeper/api/e14f58b0-d0ec-4f35-a83b-49c613daa7a3
HTTP/1.0 200 OK
{"foo":"bar"}
$ curl -X PUT \
-d '{"bar":"baz"}' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
http://127.0.0.1/JSONkeeper/api/e14f58b0-d0ec-4f35-a83b-49c613daa7a3
HTTP/1.0 200 OK
{"bar":"baz"}
Same as above, but with Content-Type: application/ld+json
. @id
get's corrected if the update doesn't use the one given when first stored.
$ curl -X DELETE \
http://127.0.0.1/JSONkeeper/api/e14f58b0-d0ec-4f35-a83b-49c613daa7a3
HTTP/1.0 200 OK
Same as above but with an additional header X-Access-Token
or X-Firebase-ID-Token
.
$ curl -X GET \
http://127.0.0.1/JSONkeeper/as/collection.json
HTTP/1.0 200 OK
{"@context": "https://www.w3.org/ns/activitystreams", "type": "Collection", … }
$ curl -X GET \
http://127.0.0.1/JSONkeeper/api/userlist
HTTP/1.0 200 OK
[
"http://127.0.0.1/JSONkeeper/api/b3529667-0949-418d-b3d8-35d64c6d6ec6",
"http://127.0.0.1/JSONkeeper/api/d69a0f6f-5e0c-4749-ab25-745d3ca016cc",
…
]
Same as above but with an additional header X-Access-Token
.
Same as above but with an additional header X-Firebase-ID-Token
.
$ curl -X GET \
http://127.0.0.1/JSONkeeper/api/b3529667-0949-418d-b3d8-35d64c6d6ec6/range1
HTTP/1.0 200 OK
{"@context": … , "@type": "sc:Range", … }