Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Creation With Upload extension #88

Merged
merged 5 commits into from
Oct 6, 2019
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,59 @@ resource. This URL MAY be absolute or relative.

The Client MUST perform the actual upload using the core protocol.

### Creation With Upload

The Client MAY want to include parts of the upload in the initial Creation
request. This MAY be achieved using the Creation With Upload extension.
Copy link
Member

@kvz kvz Sep 2, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Client MAY want to

The Client MAY

This MAY be achieved

This can be achieved

Reason is: doing this is optional. But if opt-in, we can expect to use this things, and no other thing. So I feel the second MAY is superfluous


If the Server supports this extension, it MUST advertise this by including
`creation-with-upload` in the `Tus-Extension` header. Furthermore, this extension
depends directly on the Creation extension. Therefore, if the Server does not
offer the Creation extension, it MUST NOT offer the Creation With Upload
extension either.

The Client MAY include the entire upload data or a chunk of it in the body of

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAY include either the entirety or a chunk of the upload data in the body

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn, that sounds eloquent 👍

the `POST` request. In this case, similar rules as for the `PATCH` request and
response apply. The Client MUST include the
`Content-Type: application/offset+octet-stream` header. The Server SHOULD accept
as many bytes as possible and MUST include the `Upload-Offset` in the response
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upload-Offset

Upload-Offset header

and MUST set its value to the offset of the upload after applying the accepted
bytes.

The Client SHOULD verify that the Server supports this extension before sending
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Client SHOULD verify that

If the Client wants to use the extension, the Client SHOULD verify that

the `POST` request. In addition, the Client SHOULD include the
`Expect: 100-continue` header in the request to receive early feedback from the
Server, whether it will accept the creation request, before attempting to

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'on whether' in stead of 'comma whether'

transfer the first chunk.

#### Example

A non-empty `POST` request is used to create a new upload resource. The
`Upload-Offset` header in the response indicates how much data has been accepted.

**Request:**

```
POST /files HTTP/1.1
Host: tus.example.org
Content-Length: 5
Upload-Length: 100
Tus-Resumable: 1.0.0
Content-Type: application/offset+octet-stream

hello
```

**Response:**

```
HTTP/1.1 201 Created
Location: https://tus.example.org/files/24e533e02ec3bc40c387f1a0e460e216
Tus-Resumable: 1.0.0
Upload-Offset: 5
```


### Expiration

The Server MAY remove unfinished uploads once they expire. In order to indicate
Expand Down