+ All Categories
Home > Technology > JSOP in 60 seconds

JSOP in 60 seconds

Date post: 28-Nov-2014
Category:
Upload: david-nuescheler
View: 11,683 times
Download: 2 times
Share this document with a friend
Description:
Browser enabled, HTTP-based protocol designed to exchange fine-grained information efficiently.
14
Introducing: JSOP
Transcript
Page 1: JSOP in 60 seconds

Introducing:

JSOP

Page 2: JSOP in 60 seconds

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

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

Retro-style

- PUT & PATCH -> multipart POST

- Allows for Simple HTML forms

Page 5: JSOP in 60 seconds

Extensions

- Sort-Order

- Query

- Typing

- Locking

- Versioning

- Essentially: WebDAV + friends but simple

Page 6: JSOP in 60 seconds

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

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

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

Sample PATCH

PATCH /myfolder HTTP/1.1

+newdoc : { "type" : "document", "createdBy" : "me" }-olddoc>movingdoc : /otherfolder/mydocument^lastModifiedBy : "me"

Page 10: JSOP in 60 seconds

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

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

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

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

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 --


Recommended