Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
type ('o, 'e) t = [
| `Ok of 'o
| `OkChunk of 'o
| `OkStream of 'o stream
| `Created of string option
| `No_content
| `Forbidden of 'e option
| `Not_found of 'e option
| `Conflict of 'e option
| `Gone of 'e option
| `Error of 'e option
]
Return type for service handler
Note about the three distinct 200
-code constructor:
`Ok
is for RPCs that return a value that the server should encode as one blob of data. This should be the most common answer for successful returns of simple, reasonably-sized values.`OkChunk
is for RPCs that return a value that the server should encode as chunks: multiple blobs, the concatenation of which represents the data. This should be reserved for values that can be fairly large (typically over 4Kb, but this threshold may vary depending on your setup). Data is then transferred using chunked transfer encoding.`OkStream
is for RPCs that return a stream of values, not all of which are determined at the time of call.