OPTIONS request

1
2
3
4
5
6
7
8
9
10
11
12
OPTIONS /assets.json HTTP/1.1
Host: api.sharee.dev:3000
Connection: keep-alive
Referer: http://sharee.dev:4000/
Access-Control-Request-Method: POST
Origin: http://sharee.dev:4000
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.57 Safari/534.24
Access-Control-Request-Headers: Content-Type, Accept
Accept: */*
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3

OPTIONS response

1
2
3
4
5
6
7
8
HTTP/1.1 204 No Content
Connection: close
Date: Mon, 09 May 2011 19:42:45 GMT
Access-Control-Allow-Methods: *
X-UA-Compatible: IE=Edge
Access-Control-Allow-Origin: *
X-Runtime: 0.272648
Access-Control-Allow-Credentials: false

POST request

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
POST /assets.json HTTP/1.1
Host: api.sharee.dev:3000
Connection: keep-alive
Referer: http://sharee.dev:4000/
Content-Length: 20612
Origin: http://sharee.dev:4000
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.57 Safari/534.24
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryqmpusz0Bs6Nl6niA
Accept: application/json, text/javascript, */*; q=0.01
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3

------WebKitFormBoundaryqmpusz0Bs6Nl6niA
Content-Disposition: form-data; name="file[]"; filename="lfire.jpg"
Content-Type: image/jpeg

....image data...

POST response

1
2
3
4
5
6
7
8
9
10
11
12
13
HTTP/1.1 200 OK
Connection: close
Date: Mon, 09 May 2011 19:42:45 GMT
ETag: "d7d0ae26ea77ef2c5ee778b13972e71d"
X-UA-Compatible: IE=Edge
Transfer-Encoding: chunked
Content-Type: application/json; charset=utf-8
X-Runtime: 0.280477
Cache-Control: max-age=0, private, must-revalidate

e
{"abcd":"foo"}
0