Open cdolivares opened 11 years ago
Sample Request
curl -XPUT /apples/:apple_id/grapes -H 'Expect: type="sync"' -d '{
data: [
{"grape": "1"},
{"grape": "2"}
]
}'
Response
200
{
data: {
success: [],
error: []
}
}
or as an asynchronous polling request
curl -XPUT /apples/:apple_id/grapes -H 'Expect: type="async"' -d '{
data: [
{"grape": "1"},
{"grape": "2"}
]
}'
Response
100
-H "Location: http://example.com/url/to/poll
Then client periodically
GET http://example.com/url/to/poll
Server reply on request not ready
202
Server reply on request ready
200
{
data: {
success: [],
error: []
}
}
The asynchronous protocol misappropriates the 100 status code. Both protocols slightly misuse the Expect header as well. Is there a better fit?
Something like