.TH "Eliom_registration.Html5" 3o 2014-07-10 OCamldoc ""
.SH NAME
Eliom_registration.Html5 \- Eliom service registration for HTML5 page.
.SH Module
Module Eliom_registration.Html5
.SH Documentation
.sp
Module
.BI "Html5"
:
.B sig end
.sp
Eliom service registration for HTML5 page\&. This
an instance the
.B Eliom_registration\&.Registration
abstract signatures\&.
.sp
.sp
.sp
.sp
.PP
.B ===
.B Service registration
.B ===
.PP
.I val register
:
.B ?scope:[< Eliom_common.scope ] ->
.B ?options:unit ->
.B ?charset:string ->
.B ?code:int ->
.B ?content_type:string ->
.B ?headers:Http_headers.t ->
.B ?secure_session:bool ->
.B service:('get, 'post, [< Eliom_service.internal_service_kind ],
.B [< Eliom_service.suff ], 'gn, 'pn, [ `Registrable ],
.B [< Eliom_service.http_service ])
.B Eliom_service.service ->
.B ?error_handler:((string * exn) list ->
.B Html5_types.html Eliom_content.Html5.elt Lwt.t) ->
.B ('get -> 'post -> Html5_types.html Eliom_content.Html5.elt Lwt.t) -> unit
.sp
The function
.B register service handler
will associate the
.B service
to the function
.B handler
\&. The
.B handler
function take
two parameters, the GET and POST parameters of the current HTTP
request, and should returns the corresponding page\&.
.sp
The optional parameter
.B ~scope
is
.B Eliom_common\&.global_scope
by
default, see the Eliom manual for detailled description \&.
.sp
The optional parameter
.B ~options
is specific to each output
module, see the type description for more information\&.
.sp
The optional parameters
.B ?charset
,
.B ?code
,
.B ?content_type
and
.B ?headers
can be used to modify the HTTP answer sent by
Eliom\&. Use this with care\&.
.sp
The optional parameter
.B ~secure_session
has no effect for scope
.B Eliom_common\&.global_scope
\&. With other scopes, the parameter is used
to force the session service table in which the
.B handler
will be
registered\&. By default, the service is registred in the unsecure
session if the current request\&'s protocol is
.B http
, or in the
secure session if the protocol is
.B https
\&. If set to
.B false
(resp\&.
.B true
) the
.B handler
will be stored in the unsecure
(resp\&. secure) session\&. See the Eliom manual for an introduction
to \&.
.sp
The optional parameter
.B ~error_handler
is used to specialize the
error page when actual parameters aren\&'t compatible with the
expected type\&. The default error handler is
.B fun l \-> raise (
.B Eliom_common\&.Eliom_Typing_Error
.B l)
\&.
.sp
.sp
.I val register_service
:
.B ?scope:[< Eliom_common.scope ] ->
.B ?options:unit ->
.B ?charset:string ->
.B ?code:int ->
.B ?content_type:string ->
.B ?headers:Http_headers.t ->
.B ?secure_session:bool ->
.B ?https:bool ->
.B ?priority:int ->
.B path:Eliom_lib.Url.path ->
.B get_params:('get, [< Eliom_service.suff ] as 'a, 'gn)
.B Eliom_parameter.params_type ->
.B ?error_handler:((string * exn) list ->
.B Html5_types.html Eliom_content.Html5.elt Lwt.t) ->
.B ('get -> unit -> Html5_types.html Eliom_content.Html5.elt Lwt.t) ->
.B ('get, unit,
.B [> `Attached of
.B ([> `Internal of [> `Service ] ], [> `Get ]) Eliom_service.a_s ],
.B 'a, 'gn, unit, [< Eliom_service.registrable > `Registrable ],
.B [> Eliom_service.http_service ])
.B Eliom_service.service
.sp
Same as
.B Eliom_service\&.Http\&.service
followed by
.B Eliom_registration\&.Html5\&.register
\&.
.sp
.sp
.I val register_coservice
:
.B ?scope:[< Eliom_common.scope ] ->
.B ?options:unit ->
.B ?charset:string ->
.B ?code:int ->
.B ?content_type:string ->
.B ?headers:Http_headers.t ->
.B ?secure_session:bool ->
.B ?name:string ->
.B ?csrf_safe:bool ->
.B ?csrf_scope:[< Eliom_common.user_scope ] ->
.B ?csrf_secure:bool ->
.B ?max_use:int ->
.B ?timeout:float ->
.B ?https:bool ->
.B fallback:(unit, unit,
.B [ `Attached of
.B ([ `Internal of [ `Service ] ], [ `Get ]) Eliom_service.a_s ],
.B [ `WithoutSuffix ], unit, unit, [< Eliom_service.registrable ],
.B [< Eliom_service.http_service ])
.B Eliom_service.service ->
.B get_params:('get, [ `WithoutSuffix ], 'gn) Eliom_parameter.params_type ->
.B ?error_handler:((string * exn) list ->
.B Html5_types.html Eliom_content.Html5.elt Lwt.t) ->
.B ('get -> unit -> Html5_types.html Eliom_content.Html5.elt Lwt.t) ->
.B ('get, unit,
.B [> `Attached of
.B ([> `Internal of [> `Coservice ] ], [> `Get ]) Eliom_service.a_s ],
.B [ `WithoutSuffix ], 'gn, unit,
.B [< Eliom_service.registrable > `Registrable ],
.B [> Eliom_service.http_service ])
.B Eliom_service.service
.sp
Same as
.B Eliom_service\&.Http\&.coservice
followed by
.B Eliom_registration\&.Html5\&.register
\&.
.sp
.sp
.I val register_coservice'
:
.B ?scope:[< Eliom_common.scope ] ->
.B ?options:unit ->
.B ?charset:string ->
.B ?code:int ->
.B ?content_type:string ->
.B ?headers:Http_headers.t ->
.B ?secure_session:bool ->
.B ?name:string ->
.B ?csrf_safe:bool ->
.B ?csrf_scope:[< Eliom_common.user_scope ] ->
.B ?csrf_secure:bool ->
.B ?max_use:int ->
.B ?timeout:float ->
.B ?https:bool ->
.B get_params:('get, [ `WithoutSuffix ], 'gn) Eliom_parameter.params_type ->
.B ?error_handler:((string * exn) list ->
.B Html5_types.html Eliom_content.Html5.elt Lwt.t) ->
.B ('get -> unit -> Html5_types.html Eliom_content.Html5.elt Lwt.t) ->
.B ('get, unit, [> `Nonattached of [> `Get ] Eliom_service.na_s ],
.B [ `WithoutSuffix ], 'gn, unit,
.B [< Eliom_service.registrable > `Registrable ],
.B [> Eliom_service.http_service ])
.B Eliom_service.service
.sp
Same as
.B Eliom_service\&.Http\&.coservice\&'
followed by
.B Eliom_registration\&.Html5\&.register
\&.
.sp
.sp
.I val register_post_service
:
.B ?scope:[< Eliom_common.scope ] ->
.B ?options:unit ->
.B ?charset:string ->
.B ?code:int ->
.B ?content_type:string ->
.B ?headers:Http_headers.t ->
.B ?secure_session:bool ->
.B ?https:bool ->
.B ?priority:int ->
.B fallback:('get, unit,
.B [ `Attached of
.B ([ `Internal of [ `Coservice | `Service ] ], [ `Get ])
.B Eliom_service.a_s ],
.B [< Eliom_service.suff ] as 'a, 'gn, unit, [< `Registrable ],
.B [< Eliom_service.http_service ])
.B Eliom_service.service ->
.B post_params:('post, [ `WithoutSuffix ], 'pn) Eliom_parameter.params_type ->
.B ?error_handler:((string * exn) list ->
.B Html5_types.html Eliom_content.Html5.elt Lwt.t) ->
.B ('get -> 'post -> Html5_types.html Eliom_content.Html5.elt Lwt.t) ->
.B ('get, 'post,
.B [> `Attached of
.B ([> `Internal of [ `Coservice | `Service ] ], [> `Post ])
.B Eliom_service.a_s ],
.B 'a, 'gn, 'pn, [< Eliom_service.registrable > `Registrable ],
.B [> Eliom_service.http_service ])
.B Eliom_service.service
.sp
Same as
.B Eliom_service\&.Http\&.post_service
followed by
.B Eliom_registration\&.Html5\&.register
\&.
.sp
.sp
.I val register_post_coservice
:
.B ?scope:[< Eliom_common.scope ] ->
.B ?options:unit ->
.B ?charset:string ->
.B ?code:int ->
.B ?content_type:string ->
.B ?headers:Http_headers.t ->
.B ?secure_session:bool ->
.B ?name:string ->
.B ?csrf_safe:bool ->
.B ?csrf_scope:[< Eliom_common.user_scope ] ->
.B ?csrf_secure:bool ->
.B ?max_use:int ->
.B ?timeout:float ->
.B ?https:bool ->
.B fallback:('get, unit,
.B [ `Attached of
.B ([ `Internal of [< `Coservice | `Service ] ], [ `Get ])
.B Eliom_service.a_s ],
.B [< Eliom_service.suff ] as 'a, 'gn, unit, [< `Registrable ],
.B [< Eliom_service.http_service ])
.B Eliom_service.service ->
.B post_params:('post, [ `WithoutSuffix ], 'pn) Eliom_parameter.params_type ->
.B ?error_handler:((string * exn) list ->
.B Html5_types.html Eliom_content.Html5.elt Lwt.t) ->
.B ('get -> 'post -> Html5_types.html Eliom_content.Html5.elt Lwt.t) ->
.B ('get, 'post,
.B [> `Attached of
.B ([> `Internal of [> `Coservice ] ], [> `Post ]) Eliom_service.a_s ],
.B 'a, 'gn, 'pn, [< Eliom_service.registrable > `Registrable ],
.B [> Eliom_service.http_service ])
.B Eliom_service.service
.sp
Same as
.B Eliom_service\&.Http\&.post_coservice
followed by
.B Eliom_registration\&.Html5\&.register
\&.
.sp
.sp
.I val register_post_coservice'
:
.B ?scope:[< Eliom_common.scope ] ->
.B ?options:unit ->
.B ?charset:string ->
.B ?code:int ->
.B ?content_type:string ->
.B ?headers:Http_headers.t ->
.B ?secure_session:bool ->
.B ?name:string ->
.B ?csrf_safe:bool ->
.B ?csrf_scope:[< Eliom_common.user_scope ] ->
.B ?csrf_secure:bool ->
.B ?max_use:int ->
.B ?timeout:float ->
.B ?keep_get_na_params:bool ->
.B ?https:bool ->
.B post_params:('post, [ `WithoutSuffix ], 'pn) Eliom_parameter.params_type ->
.B ?error_handler:((string * exn) list ->
.B Html5_types.html Eliom_content.Html5.elt Lwt.t) ->
.B (unit -> 'post -> Html5_types.html Eliom_content.Html5.elt Lwt.t) ->
.B (unit, 'post, [> `Nonattached of [> `Post ] Eliom_service.na_s ],
.B [ `WithoutSuffix ], unit, 'pn,
.B [< Eliom_service.registrable > `Registrable ],
.B [> Eliom_service.http_service ])
.B Eliom_service.service
.sp
Same as
.B Eliom_service\&.Http\&.post_coservice\&'
followed by
.B Eliom_registration\&.Html5\&.register
\&.
.sp
.sp
.I val register_put_service
:
.B ?scope:[< Eliom_common.scope ] ->
.B ?options:unit ->
.B ?charset:string ->
.B ?code:int ->
.B ?content_type:string ->
.B ?headers:Http_headers.t ->
.B ?secure_session:bool ->
.B ?https:bool ->
.B ?priority:int ->
.B path:Eliom_lib.Url.path ->
.B get_params:('get, [< Eliom_service.suff ] as 'a, 'gn)
.B Eliom_parameter.params_type ->
.B ?error_handler:((string * exn) list ->
.B Html5_types.html Eliom_content.Html5.elt Lwt.t) ->
.B ('get ->
.B Eliom_parameter.raw_post_data ->
.B Html5_types.html Eliom_content.Html5.elt Lwt.t) ->
.B ('get, Eliom_parameter.raw_post_data,
.B [> `Attached of
.B ([> `Internal of [> `Service ] ], [> `Put ]) Eliom_service.a_s ],
.B 'a, 'gn, Eliom_parameter.no_param_name,
.B [< Eliom_service.registrable > `Registrable ],
.B [> Eliom_service.http_service ])
.B Eliom_service.service
.sp
Same as
.B Eliom_service\&.Http\&.put_service
followed by
.B Eliom_registration\&.Html5\&.register
\&.
.sp
.sp
.I val register_put_coservice
:
.B ?scope:[< Eliom_common.scope ] ->
.B ?options:unit ->
.B ?charset:string ->
.B ?code:int ->
.B ?content_type:string ->
.B ?headers:Http_headers.t ->
.B ?secure_session:bool ->
.B ?name:string ->
.B ?csrf_safe:bool ->
.B ?csrf_scope:[< Eliom_common.user_scope ] ->
.B ?csrf_secure:bool ->
.B ?max_use:int ->
.B ?timeout:float ->
.B ?https:bool ->
.B fallback:(unit, Eliom_parameter.raw_post_data,
.B [ `Attached of
.B ([ `Internal of [ `Service ] ], [ `Put ]) Eliom_service.a_s ],
.B [ `WithoutSuffix ], unit, Eliom_parameter.no_param_name,
.B [< Eliom_service.registrable ], [< Eliom_service.http_service ])
.B Eliom_service.service ->
.B get_params:('get, [ `WithoutSuffix ], 'gn) Eliom_parameter.params_type ->
.B ?error_handler:((string * exn) list ->
.B Html5_types.html Eliom_content.Html5.elt Lwt.t) ->
.B ('get ->
.B Eliom_parameter.raw_post_data ->
.B Html5_types.html Eliom_content.Html5.elt Lwt.t) ->
.B ('get, Eliom_parameter.raw_post_data,
.B [> `Attached of
.B ([> `Internal of [> `Coservice ] ], [> `Put ]) Eliom_service.a_s ],
.B [ `WithoutSuffix ], 'gn, Eliom_parameter.no_param_name,
.B [< Eliom_service.registrable > `Registrable ],
.B [> Eliom_service.http_service ])
.B Eliom_service.service
.sp
Same as
.B Eliom_service\&.Http\&.put_coservice
followed by
.B Eliom_registration\&.Html5\&.register
\&.
.sp
.sp
.I val register_put_coservice'
:
.B ?scope:[< Eliom_common.scope ] ->
.B ?options:unit ->
.B ?charset:string ->
.B ?code:int ->
.B ?content_type:string ->
.B ?headers:Http_headers.t ->
.B ?secure_session:bool ->
.B ?name:string ->
.B ?csrf_safe:bool ->
.B ?csrf_scope:[< Eliom_common.user_scope ] ->
.B ?csrf_secure:bool ->
.B ?max_use:int ->
.B ?timeout:float ->
.B ?https:bool ->
.B get_params:('get, [ `WithoutSuffix ], 'gn) Eliom_parameter.params_type ->
.B ?error_handler:((string * exn) list ->
.B Html5_types.html Eliom_content.Html5.elt Lwt.t) ->
.B ('get ->
.B Eliom_parameter.raw_post_data ->
.B Html5_types.html Eliom_content.Html5.elt Lwt.t) ->
.B ('get, Eliom_parameter.raw_post_data,
.B [> `Nonattached of [> `Put ] Eliom_service.na_s ], [ `WithoutSuffix ], 'gn,
.B Eliom_parameter.no_param_name,
.B [< Eliom_service.registrable > `Registrable ],
.B [> Eliom_service.http_service ])
.B Eliom_service.service
.sp
Same as
.B Eliom_service\&.Http\&.put_coservice\&'
followed by
.B Eliom_registration\&.Html5\&.register
\&.
.sp
.sp
.I val register_delete_service
:
.B ?scope:[< Eliom_common.scope ] ->
.B ?options:unit ->
.B ?charset:string ->
.B ?code:int ->
.B ?content_type:string ->
.B ?headers:Http_headers.t ->
.B ?secure_session:bool ->
.B ?https:bool ->
.B ?priority:int ->
.B path:Eliom_lib.Url.path ->
.B get_params:('get, [< Eliom_service.suff ] as 'a, 'gn)
.B Eliom_parameter.params_type ->
.B ?error_handler:((string * exn) list ->
.B Html5_types.html Eliom_content.Html5.elt Lwt.t) ->
.B ('get ->
.B Eliom_parameter.raw_post_data ->
.B Html5_types.html Eliom_content.Html5.elt Lwt.t) ->
.B ('get, Eliom_parameter.raw_post_data,
.B [> `Attached of
.B ([> `Internal of [> `Service ] ], [> `Delete ]) Eliom_service.a_s ],
.B 'a, 'gn, Eliom_parameter.no_param_name,
.B [< Eliom_service.registrable > `Registrable ],
.B [> Eliom_service.http_service ])
.B Eliom_service.service
.sp
Same as
.B Eliom_service\&.Http\&.delete_service
followed by
.B Eliom_registration\&.Html5\&.register
\&.
.sp
.sp
.I val register_delete_coservice
:
.B ?scope:[< Eliom_common.scope ] ->
.B ?options:unit ->
.B ?charset:string ->
.B ?code:int ->
.B ?content_type:string ->
.B ?headers:Http_headers.t ->
.B ?secure_session:bool ->
.B ?name:string ->
.B ?csrf_safe:bool ->
.B ?csrf_scope:[< Eliom_common.user_scope ] ->
.B ?csrf_secure:bool ->
.B ?max_use:int ->
.B ?timeout:float ->
.B ?https:bool ->
.B fallback:(unit, Eliom_parameter.raw_post_data,
.B [ `Attached of
.B ([ `Internal of [ `Service ] ], [ `Delete ]) Eliom_service.a_s ],
.B [ `WithoutSuffix ], unit, Eliom_parameter.no_param_name,
.B [< Eliom_service.registrable ], [< Eliom_service.http_service ])
.B Eliom_service.service ->
.B get_params:('get, [ `WithoutSuffix ], 'gn) Eliom_parameter.params_type ->
.B ?error_handler:((string * exn) list ->
.B Html5_types.html Eliom_content.Html5.elt Lwt.t) ->
.B ('get ->
.B Eliom_parameter.raw_post_data ->
.B Html5_types.html Eliom_content.Html5.elt Lwt.t) ->
.B ('get, Eliom_parameter.raw_post_data,
.B [> `Attached of
.B ([> `Internal of [> `Coservice ] ], [> `Delete ]) Eliom_service.a_s ],
.B [ `WithoutSuffix ], 'gn, Eliom_parameter.no_param_name,
.B [< Eliom_service.registrable > `Registrable ],
.B [> Eliom_service.http_service ])
.B Eliom_service.service
.sp
Same as
.B Eliom_service\&.Http\&.delete_coservice
followed by
.B Eliom_registration\&.Html5\&.register
\&.
.sp
.sp
.I val register_delete_coservice'
:
.B ?scope:[< Eliom_common.scope ] ->
.B ?options:unit ->
.B ?charset:string ->
.B ?code:int ->
.B ?content_type:string ->
.B ?headers:Http_headers.t ->
.B ?secure_session:bool ->
.B ?name:string ->
.B ?csrf_safe:bool ->
.B ?csrf_scope:[< Eliom_common.user_scope ] ->
.B ?csrf_secure:bool ->
.B ?max_use:int ->
.B ?timeout:float ->
.B ?https:bool ->
.B get_params:('get, [ `WithoutSuffix ], 'gn) Eliom_parameter.params_type ->
.B ?error_handler:((string * exn) list ->
.B Html5_types.html Eliom_content.Html5.elt Lwt.t) ->
.B ('get ->
.B Eliom_parameter.raw_post_data ->
.B Html5_types.html Eliom_content.Html5.elt Lwt.t) ->
.B ('get, Eliom_parameter.raw_post_data,
.B [> `Nonattached of [> `Delete ] Eliom_service.na_s ], [ `WithoutSuffix ],
.B 'gn, Eliom_parameter.no_param_name,
.B [< Eliom_service.registrable > `Registrable ],
.B [> Eliom_service.http_service ])
.B Eliom_service.service
.sp
Same as
.B Eliom_service\&.Http\&.delete_coservice\&'
followed by
.B Eliom_registration\&.Html5\&.register
\&.
.sp
.sp
.PP
.B ===
.B Low\-level function
.B ===
.PP
.I val send
:
.B ?options:unit ->
.B ?charset:string ->
.B ?code:int ->
.B ?content_type:string ->
.B ?headers:Http_headers.t ->
.B Html5_types.html Eliom_content.Html5.elt ->
.B Eliom_registration.browser_content Eliom_registration.kind Lwt.t
.sp
The function
.B send page
build the HTTP frame corresponding to
.B page
\&. This may be used for example in an service handler
registered with
.B Eliom_registration\&.Any\&.register
or when building a
custom output module\&.
.sp
.sp