Simplify!

This commit is contained in:
Felix Geisendörfer 2013-03-17 11:41:45 +01:00
parent 65989e9294
commit 2b8c184c40
1 changed files with 17 additions and 21 deletions

View File

@ -40,7 +40,7 @@ POST /files HTTP/1.1
Host: tus.example.com Host: tus.example.com
Content-Length: 0 Content-Length: 0
Content-Range: bytes */100 Content-Range: bytes */100
Content-Type: "image/png" Content-Type: image/jpg
``` ```
**Response:** **Response:**
@ -48,15 +48,7 @@ Content-Type: "image/png"
``` ```
HTTP/1.1 201 Created HTTP/1.1 201 Created
Location: http://tus.example.com/files/123d3ebc995732b2 Location: http://tus.example.com/files/123d3ebc995732b2
``` Content-Length: 0
```json
{
"id": "123d3ebc995732b2",
"url": "http://tus.example.com/files/123d3ebc995732b2",
"received": 0,
"size": 0,
"parts": []
}
``` ```
### PUT /files/\<id\> ### PUT /files/\<id\>
@ -77,26 +69,30 @@ Content-Range: bytes 0-99/100
HTTP/1.1 200 Ok HTTP/1.1 200 Ok
``` ```
### GET /files/123d3ebc995732b2 ### HEAD /files/\<id\>
### GET /files/\<id\>
Used to download an uploaded file.
**Request:** **Request:**
``` ```
GET /files/123d3ebc995732b2/d930cc9d304cc667 HTTP/1.1 GET /files/123d3ebc995732b2 HTTP/1.1
Host: tus.example.com Host: tus.example.com
Content-Length: 0
``` ```
The server responds by informing the client about the state of the file upload **Response:**
upload:
``` ```
{ HTTP/1.1 200 Ok
"id": "123d3ebc995732b2", Content-Length: 100
"received": 0, Content-Type: image/jpg
"size": 0,
"parts": []
}
``` ```
```
[file data]
```
## License ## License