feat: use escape quoutes

This commit is contained in:
2025-04-19 12:42:10 +02:00
parent fcf57b0455
commit 6a14f855f3

32
DOCS.md
View File

@ -17,21 +17,21 @@ headers:
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.
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.
## 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
"data-format" header
Server informs client and reminds in which format he should send the data through
`data-format` header
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.
Otherwise it sends "x-stream: n" where 'n' is amount of bytes that server is able
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
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
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
headers:
@ -41,7 +41,7 @@ headers:
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.
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
@ -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.
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.
## 4. Server waits
@ -67,10 +67,10 @@ headers:
payload: -
```
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
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
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:
@ -82,7 +82,7 @@ headers:
payload: -
```
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
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
of bytes that didn't arrive due to specific issues, e.g. running out of the storage.