Skip to content

Instantly share code, notes, and snippets.

@Acconut
Last active August 29, 2015 14:14
Show Gist options
  • Save Acconut/65228c8486e284d49e10 to your computer and use it in GitHub Desktop.
Save Acconut/65228c8486e284d49e10 to your computer and use it in GitHub Desktop.
# Create three file uploads and mark them as "partial"
POST /files
Merge: partial
Enity-Length: 100
204 No Content
Location: tus.io/files/a
POST /files
Merge: partial
Enity-Length: 200
204 No Content
Location: tus.io/files/b
POST /files
Merge: partial
Enity-Length: 300
204 No Content
Location: tus.io/files/c
# Create a new upload with concates a, b and c in this order
# No Enity-Length header because it's the length of a + b + c
# No data has been uploade to a. b. c yet (but can be in real world use cases)
POST /files
Merge: final; tus.io/files/a, tus.io/files/b, tus.io/files/c
204 No Content
Loation: tus.io/files/abc
# Upload data as long as the three uploads are no full
# Once all data has been recieved abc is done, too.
PATCH /files/a
...
PATCH /files/b
...
PATCH /files/c
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment