Page
Library
Module
Module type
Parameter
Class
Class type
Source
Resto.MakeServiceSourceServices.
val output_encoding :
('meth, 'prefix, 'params, 'query, 'input, 'output, 'error) service ->
'output Encoding.tval error_encoding :
('meth, 'prefix, 'params, 'query, 'input, 'output, 'error) service ->
'error Encoding.tval get_service :
?description:string ->
query:'query Query.t ->
output:'output Encoding.t ->
error:'error Encoding.t ->
('prefix, 'params) Path.t ->
([ `GET ], 'prefix, 'params, 'query, unit, 'output, 'error) serviceget_service ?description ~query ~output ~error path is a GET service that is intended to seat at the URI described by path and receive the additional parameters described by query. The value output (resp. error) describe the representation of the successful (resp. failed) returned value for the service.
Note that, whilst get_service declares a service, the resulting service is not registered yet. This is handled in Resto_directory.
post_service, delete_service, put_service, and patch_service are similar to get_service but for the other HTTP methods.
Note that some of these functions take an additional input argument. This is only for the services with methods that expect additional parameters. It is used internally to encode/decode additional parameters passed in a dedicated payload rather than in the path/query parameters.
val post_service :
?description:string ->
query:'query Query.t ->
input:'input Encoding.t ->
output:'output Encoding.t ->
error:'error Encoding.t ->
('prefix, 'params) Path.t ->
([ `POST ], 'prefix, 'params, 'query, 'input, 'output, 'error) serviceval delete_service :
?description:string ->
query:'query Query.t ->
output:'output Encoding.t ->
error:'error Encoding.t ->
('prefix, 'params) Path.t ->
([ `DELETE ], 'prefix, 'params, 'query, unit, 'output, 'error) serviceval patch_service :
?description:string ->
query:'query Query.t ->
input:'input Encoding.t ->
output:'output Encoding.t ->
error:'error Encoding.t ->
('prefix, 'params) Path.t ->
([ `PATCH ], 'prefix, 'params, 'query, 'input, 'output, 'error) serviceval put_service :
?description:string ->
query:'query Query.t ->
input:'input Encoding.t ->
output:'output Encoding.t ->
error:'error Encoding.t ->
('prefix, 'params) Path.t ->
([ `PUT ], 'prefix, 'params, 'query, 'input, 'output, 'error) servicetype ('prefix, 'params, 'error) description_service =
([ `GET ],
'prefix,
'params * string list,
Description.request,
unit,
Encoding.schema Description.directory,
'error)
serviceval description_service :
?description:string ->
'error Encoding.t ->
('prefix, 'params) Path.t ->
('prefix, 'params, 'error) description_service