feat: use escape quoutes
This commit is contained in:
30
DOCS.md
30
DOCS.md
@ -17,21 +17,21 @@ headers:
|
|||||||
payload: -
|
payload: -
|
||||||
```
|
```
|
||||||
|
|
||||||
"x-stream" header defines how much data client wants to send in total and which buffer
|
`x-stream` header defines how much data client wants to send in total and which buffer
|
||||||
size it will use for each portion of data. These two values are separated with colon.
|
size it will use for each portion of data. These two values are separated with colon.
|
||||||
Client should also acknowledge server about target type of the data through "data-format"
|
Client should also acknowledge server about target type of the data through `data-format`
|
||||||
header.
|
header.
|
||||||
|
|
||||||
## 2. Server sees the "x-stream" header and sends back a packet
|
## 2. Server sees the `x-stream` header and sends back a packet
|
||||||
|
|
||||||
Server informs client and reminds in which format he should send the data through
|
Server informs client and reminds in which format he should send the data through
|
||||||
"data-format" header
|
`data-format` header
|
||||||
|
|
||||||
Server informs client how much data it can receive and hold through use of "x-stream"
|
Server informs client how much data it can receive and hold through use of `x-stream`
|
||||||
header. If server can handle whole amount, then it sends "x-stream: 0" back.
|
header. If server can handle whole amount, then it sends `x-stream: 0` back
|
||||||
Otherwise it sends "x-stream: n" where 'n' is amount of bytes that server is able
|
Otherwise it sends `x-stream: n` where 'n' is amount of bytes that server is able
|
||||||
to receive. If server doesn't support stream requests on that route or for some
|
to receive. If server doesn't support stream requests on that route or for some
|
||||||
reason can't handle that stream it sends "x-stream: -1" indicating an error
|
reason can't handle that stream it sends `x-stream: -1` indicating an error
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
headers:
|
headers:
|
||||||
@ -41,7 +41,7 @@ headers:
|
|||||||
payload: -
|
payload: -
|
||||||
```
|
```
|
||||||
|
|
||||||
Apart from that, server sends additional header "x-stream-key" that can later be used
|
Apart from that, server sends additional header `x-stream-key` that can later be used
|
||||||
to try identifying the stream after possible error or break of the connection.
|
to try identifying the stream after possible error or break of the connection.
|
||||||
This header helps both sides identify the stream and recover from a loss of connection
|
This header helps both sides identify the stream and recover from a loss of connection
|
||||||
or any other issue. For example server might use that key for identifying the filename
|
or any other issue. For example server might use that key for identifying the filename
|
||||||
@ -51,7 +51,7 @@ in internal database and continue receiving file data.
|
|||||||
|
|
||||||
Client should also save the stream key in order to be able to recover.
|
Client should also save the stream key in order to be able to recover.
|
||||||
|
|
||||||
At this point the server is ready to accept raw data from the "stream". The client
|
At this point the server is ready to accept raw data from the `stream`. The client
|
||||||
should try to send data in portion of buffer size that the server has specified.
|
should try to send data in portion of buffer size that the server has specified.
|
||||||
|
|
||||||
## 4. Server waits
|
## 4. Server waits
|
||||||
@ -67,10 +67,10 @@ headers:
|
|||||||
payload: -
|
payload: -
|
||||||
```
|
```
|
||||||
|
|
||||||
Server sends back a packet containing a "status" header identifying the status of
|
Server sends back a packet containing a `status` header identifying the status of
|
||||||
transferring. Additionally it sends the same stream key and "x-stream" header again
|
transferring. Additionally it sends the same stream key and `x-stream` header again
|
||||||
containing information about how much data didn't arrive. In successful scenario it
|
containing information about how much data didn't arrive. In successful scenario it
|
||||||
should equal to "0:0" identifying 0 bytes left.
|
should equal to `0:0` identifying 0 bytes left.
|
||||||
|
|
||||||
In case of an error the server might send packet in following schema:
|
In case of an error the server might send packet in following schema:
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ headers:
|
|||||||
payload: -
|
payload: -
|
||||||
```
|
```
|
||||||
|
|
||||||
To identify if request wasn't successful, the server will send a "status" header
|
To identify if request wasn't successful, the server will send a `status` header
|
||||||
that will contain "non-zero" error number and "x-stream" header containing the amount
|
that will contain `non-zero` error number and `x-stream` header containing the amount
|
||||||
of bytes that didn't arrive due to specific issues, e.g. running out of the storage.
|
of bytes that didn't arrive due to specific issues, e.g. running out of the storage.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user