JSOP in 60 seconds
-
Upload
david-nuescheler -
Category
Technology
-
view
11.684 -
download
2
description
Transcript of JSOP in 60 seconds
![Page 1: JSOP in 60 seconds](https://reader036.fdocuments.in/reader036/viewer/2022082915/5479b967b4af9fb9158b4915/html5/thumbnails/1.jpg)
Introducing:
JSOP
![Page 2: JSOP in 60 seconds](https://reader036.fdocuments.in/reader036/viewer/2022082915/5479b967b4af9fb9158b4915/html5/thumbnails/2.jpg)
Pitch & Goal
- Browser enabled, HTTP-based protocol designed to exchange fine-grained information efficiently.
- Easy to consume by todays Web-”Gear” (browsers, flash & friends)
- Probably suitable for an RFC @ IETF
![Page 3: JSOP in 60 seconds](https://reader036.fdocuments.in/reader036/viewer/2022082915/5479b967b4af9fb9158b4915/html5/thumbnails/3.jpg)
Basics
- Serialization to JSON (optionally YAML/XML)
- GET (batch/hierarchical)
- PUT (batch/hierarchical)
- PATCH (json diff content type)
- Support for binary as multipart
![Page 4: JSOP in 60 seconds](https://reader036.fdocuments.in/reader036/viewer/2022082915/5479b967b4af9fb9158b4915/html5/thumbnails/4.jpg)
Retro-style
- PUT & PATCH -> multipart POST
- Allows for Simple HTML forms
![Page 5: JSOP in 60 seconds](https://reader036.fdocuments.in/reader036/viewer/2022082915/5479b967b4af9fb9158b4915/html5/thumbnails/5.jpg)
Extensions
- Sort-Order
- Query
- Typing
- Locking
- Versioning
- Essentially: WebDAV + friends but simple
![Page 6: JSOP in 60 seconds](https://reader036.fdocuments.in/reader036/viewer/2022082915/5479b967b4af9fb9158b4915/html5/thumbnails/6.jpg)
Sample GET
Request:GET /myfolder.json HTTP/1.1
Response:{"createdBy" : "uncled","name" : "myfolder","id" : "50d9317a-3a95-401a-9638-333a0dbf04bb""type" : "folder"}
![Page 7: JSOP in 60 seconds](https://reader036.fdocuments.in/reader036/viewer/2022082915/5479b967b4af9fb9158b4915/html5/thumbnails/7.jpg)
Sample GET 2
Request:GET /myfolder.4.json HTTP/1.1
Response:{"createdBy" : "uncled","name" : "myfolder","id" : "50d9317a-3a95-401a-9638-333a0dbf04bb""type" : "folder"
"child1" : { "grandchild11" : { "depth3" : { "depth4 : { ... } } } }}
![Page 8: JSOP in 60 seconds](https://reader036.fdocuments.in/reader036/viewer/2022082915/5479b967b4af9fb9158b4915/html5/thumbnails/8.jpg)
Sample PUT
PUT /myfolder HTTP/1.1
{"createdBy" : "uncled","name" : "myfolder","id" : "50d9317a-3a95-401a-9638-333a0dbf04bb""type" : "folder"
"child1" : { "grandchild11" : { "depth3" : { "depth4 : { ... } } } }}
![Page 9: JSOP in 60 seconds](https://reader036.fdocuments.in/reader036/viewer/2022082915/5479b967b4af9fb9158b4915/html5/thumbnails/9.jpg)
Sample PATCH
PATCH /myfolder HTTP/1.1
+newdoc : { "type" : "document", "createdBy" : "me" }-olddoc>movingdoc : /otherfolder/mydocument^lastModifiedBy : "me"
![Page 10: JSOP in 60 seconds](https://reader036.fdocuments.in/reader036/viewer/2022082915/5479b967b4af9fb9158b4915/html5/thumbnails/10.jpg)
PATCH diff ops
"+":create Node/Property/Resource
"^":update Node/Property/Resource
"-":delete Node/Property/Resource
">":move Node/Property/Resource
![Page 11: JSOP in 60 seconds](https://reader036.fdocuments.in/reader036/viewer/2022082915/5479b967b4af9fb9158b4915/html5/thumbnails/11.jpg)
PATCH diff
diff ::= membersmembers ::= pair | pairspair ::= key [ " : " value ]pairs ::= pair line-end pair | pair line-end pairsline-end ::= "\r\n" | "\n" | "\r"key ::= opchar idopchar ::= "+" | "^" | "-" | ">"id ::= * identification url (path | id) *value ::= value+ | value- | value^ | value>value+ ::= * a JSON object *value- ::= ""value^ ::= * any JSON value except JSON object *value> ::= id
![Page 12: JSOP in 60 seconds](https://reader036.fdocuments.in/reader036/viewer/2022082915/5479b967b4af9fb9158b4915/html5/thumbnails/12.jpg)
POST wrap 1
POST /myfolder/my.gif HTTP/1.1Content-Type: multipart/form-data; boundary=---------21447684891610979728262467120Content-Length: 123
---------21447684891610979728262467120Content-Disposition: form-data; name="data"Content-Type: image/gif
GIF89a...................!.......,............s...f.; ---------21447684891610979728262467120Content-Disposition: form-data; name="jsop:diff"Content-Type: text/plain
^lastModifiedBy : "me"+exif { cameraMake : "Apple", cameraModel : "Apple" }---------21447684891610979728262467120--
![Page 13: JSOP in 60 seconds](https://reader036.fdocuments.in/reader036/viewer/2022082915/5479b967b4af9fb9158b4915/html5/thumbnails/13.jpg)
POST wrap 2
POST /myfolder/my.gif HTTP/1.1Content-Type: multipart/form-data; boundary=---------21447684891610979728262467120Content-Length: 123
---------21447684891610979728262467120Content-Disposition: form-data; name="exif/cameraMake"Content-Type: text/plain
Another Vendor---------21447684891610979728262467120--
![Page 14: JSOP in 60 seconds](https://reader036.fdocuments.in/reader036/viewer/2022082915/5479b967b4af9fb9158b4915/html5/thumbnails/14.jpg)
POST wrap 3
POST /myfolder/ HTTP/1.1Content-Type: multipart/form-data; boundary=---------21447684891610979728262467120Content-Length: 123
---------21447684891610979728262467120Content-Disposition: form-data; name=""; filename="my.gif"Content-Type: image/gif
GIF89a...................!.......,............s...f.; ---------21447684891610979728262467120Content-Disposition: form-data; name=""; filename="yo.gif"Content-Type: image/gif
GIF89a...................!.......,............s...f.; ---------21447684891610979728262467120 --