---
name: "Eliom_registration.Block.server"
section: "3o"
platform: "linux"
package: "libeliom-ocaml-doc"
version: "2.2.2-1"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/Eliom_registration.Block.server"
---

# Eliom\_registration.Block.server(3o)

Eliom service registration and forms creation for fragment of XHTML page.

## NAME

Eliom\_registration.Block - Eliom service registration and forms creation for fragment of XHTML page.

## Module

Module   Eliom\_registration.Block

## Documentation

Module **Block**\
  :  **sig end**

Eliom service registration and forms creation for fragment of XHTML page. This is an instance of the  **Eliom\_registration.Registration** abstract signature.

**===** **Service registration** **===**

*val register* :  **?scope:\[\< Eliom\_common.scope \] -\>** **?options:unit -\>** **?charset:string -\>** **?code:int -\>** **?content\_type:string -\>** **?headers:Http\_headers.t -\>** **?secure\_session:bool -\>** **service:('a, 'b, \[\< Eliom\_service.internal\_service\_kind \],** **\[\< Eliom\_service.suff \], 'c, 'd, \[ \`Registrable \],** **Eliom\_registration.http\_service)** **Eliom\_service.service -\>** **?error\_handler:((string \* exn) list -\>** **Xhtml\_types.body\_content Eliom\_content\_core.Xhtml.F.elt list** **Lwt.t) -\>** **('a -\>** **'b -\> Xhtml\_types.body\_content Eliom\_content\_core.Xhtml.F.elt list Lwt.t) -\>** **unit**

The function  **register service handler** will associate the **service** to the function  **handler** . The  **handler** function take two parameters, the GET and POST parameters of the current HTTP request, and should returns the corresponding page.

The optional parameter  **~scope** is  **Eliom\_common.global** by default, see the Eliom manual for detailled description .

The optional parameter  **~options** is specific to each output module, see the type description for more information.

The optional parameters  **?charset** ,  **?code** ,  **?content\_type** and **?headers** can be used to modify the HTTP answer sent by Eliom. Use this with care.

The optional parameter  **~secure\_session** has no effect for scope **Eliom\_common.global** . With other scopes, the parameter is used to force the session service table in which the  **handler** will be registered. By default, the service is registred in the unsecure session if the current request's protocol is  **http** , or in the secure session if the protocol is  **https** . If set to  **false** (resp.  **true** ) the  **handler** will be stored in the unsecure (resp. secure) session. See the Eliom manual for an introduction to .

The optional parameter  **~error\_handler** is used to specialize the error page when actual parameters aren't compatible with the expected type. The default error handler is **fun l -\> raise (** **Eliom\_common.Eliom\_Typing\_Error** **l)** .

*val register\_service* :  **?scope:\[\< Eliom\_common.scope \] -\>** **?options:unit -\>** **?charset:string -\>** **?code:int -\>** **?content\_type:string -\>** **?headers:Http\_headers.t -\>** **?secure\_session:bool -\>** **?https:bool -\>** **?priority:int -\>** **path:Eliom\_lib.Url.path -\>** **get\_params:('a, \[\< Eliom\_service.suff \] as 'b, 'c)** **Eliom\_parameter.params\_type -\>** **?error\_handler:((string \* exn) list -\>** **Xhtml\_types.body\_content Eliom\_content\_core.Xhtml.F.elt list** **Lwt.t) -\>** **('a -\>** **unit -\> Xhtml\_types.body\_content Eliom\_content\_core.Xhtml.F.elt list Lwt.t) -\>** **('a, unit,** **\[\> \`Attached of** **(\[\> \`Internal of \[\> \`Service \] \], \[\> \`Get \]) Eliom\_service.a\_s \],** **'b, 'c, unit, \[\< Eliom\_service.registrable \> \`Registrable \],** **Eliom\_registration.http\_service)** **Eliom\_service.service**

Same as  **Eliom\_service.service** followed by  **Eliom\_registration.Block.register** .

*val register\_coservice* :  **?scope:\[\< Eliom\_common.scope \] -\>** **?options:unit -\>** **?charset:string -\>** **?code:int -\>** **?content\_type:string -\>** **?headers:Http\_headers.t -\>** **?secure\_session:bool -\>** **?name:string -\>** **?csrf\_safe:bool -\>** **?csrf\_scope:\[\< Eliom\_common.user\_scope \] -\>** **?csrf\_secure:bool -\>** **?max\_use:int -\>** **?timeout:float -\>** **?https:bool -\>** **fallback:(unit, unit,** **\[ \`Attached of** **(\[ \`Internal of \[ \`Service \] \], \[ \`Get \]) Eliom\_service.a\_s \],** **\[ \`WithoutSuffix \], unit, unit, \[\< Eliom\_service.registrable \],** **Eliom\_registration.http\_service)** **Eliom\_service.service -\>** **get\_params:('a, \[ \`WithoutSuffix \], 'b) Eliom\_parameter.params\_type -\>** **?error\_handler:((string \* exn) list -\>** **Xhtml\_types.body\_content Eliom\_content\_core.Xhtml.F.elt list** **Lwt.t) -\>** **('a -\>** **unit -\> Xhtml\_types.body\_content Eliom\_content\_core.Xhtml.F.elt list Lwt.t) -\>** **('a, unit,** **\[\> \`Attached of** **(\[\> \`Internal of \[\> \`Coservice \] \], \[\> \`Get \]) Eliom\_service.a\_s \],** **\[ \`WithoutSuffix \], 'b, unit, \[\< Eliom\_service.registrable \> \`Registrable \],** **Eliom\_registration.http\_service)** **Eliom\_service.service**

Same as  **Eliom\_service.coservice** followed by  **Eliom\_registration.Block.register** .

*val register\_coservice'* :  **?scope:\[\< Eliom\_common.scope \] -\>** **?options:unit -\>** **?charset:string -\>** **?code:int -\>** **?content\_type:string -\>** **?headers:Http\_headers.t -\>** **?secure\_session:bool -\>** **?name:string -\>** **?csrf\_safe:bool -\>** **?csrf\_scope:\[\< Eliom\_common.user\_scope \] -\>** **?csrf\_secure:bool -\>** **?max\_use:int -\>** **?timeout:float -\>** **?https:bool -\>** **get\_params:('a, \[ \`WithoutSuffix \], 'b) Eliom\_parameter.params\_type -\>** **?error\_handler:((string \* exn) list -\>** **Xhtml\_types.body\_content Eliom\_content\_core.Xhtml.F.elt list** **Lwt.t) -\>** **('a -\>** **unit -\> Xhtml\_types.body\_content Eliom\_content\_core.Xhtml.F.elt list Lwt.t) -\>** **('a, unit, \[\> \`Nonattached of \[\> \`Get \] Eliom\_service.na\_s \],** **\[ \`WithoutSuffix \], 'b, unit, \[\< Eliom\_service.registrable \> \`Registrable \],** **Eliom\_registration.http\_service)** **Eliom\_service.service**

Same as  **Eliom\_service.coservice'** followed by  **Eliom\_registration.Block.register** .

*val register\_post\_service* :  **?scope:\[\< Eliom\_common.scope \] -\>** **?options:unit -\>** **?charset:string -\>** **?code:int -\>** **?content\_type:string -\>** **?headers:Http\_headers.t -\>** **?secure\_session:bool -\>** **?https:bool -\>** **?priority:int -\>** **fallback:('a, unit,** **\[ \`Attached of** **(\[ \`Internal of \[ \`Coservice \| \`Service \] \], \[ \`Get \])** **Eliom\_service.a\_s \],** **\[\< Eliom\_service.suff \] as 'b, 'c, unit, \[\< \`Registrable \], 'd)** **Eliom\_service.service -\>** **post\_params:('e, \[ \`WithoutSuffix \], 'f) Eliom\_parameter.params\_type -\>** **?error\_handler:((string \* exn) list -\>** **Xhtml\_types.body\_content Eliom\_content\_core.Xhtml.F.elt list** **Lwt.t) -\>** **('a -\>** **'e -\> Xhtml\_types.body\_content Eliom\_content\_core.Xhtml.F.elt list Lwt.t) -\>** **('a, 'e,** **\[\> \`Attached of** **(\[\> \`Internal of \[ \`Coservice \| \`Service \] \], \[\> \`Post \])** **Eliom\_service.a\_s \],** **'b, 'c, 'f, \[\< Eliom\_service.registrable \> \`Registrable \],** **Eliom\_registration.http\_service)** **Eliom\_service.service**

Same as  **Eliom\_service.post\_service** followed by  **Eliom\_registration.Block.register** .

*val register\_post\_coservice* :  **?scope:\[\< Eliom\_common.scope \] -\>** **?options:unit -\>** **?charset:string -\>** **?code:int -\>** **?content\_type:string -\>** **?headers:Http\_headers.t -\>** **?secure\_session:bool -\>** **?name:string -\>** **?csrf\_safe:bool -\>** **?csrf\_scope:\[\< Eliom\_common.user\_scope \] -\>** **?csrf\_secure:bool -\>** **?max\_use:int -\>** **?timeout:float -\>** **?https:bool -\>** **fallback:('a, unit,** **\[ \`Attached of** **(\[ \`Internal of \[\< \`Coservice \| \`Service \] \], \[ \`Get \])** **Eliom\_service.a\_s \],** **\[\< Eliom\_service.suff \] as 'b, 'c, unit, \[\< \`Registrable \],** **Eliom\_registration.http\_service)** **Eliom\_service.service -\>** **post\_params:('d, \[ \`WithoutSuffix \], 'e) Eliom\_parameter.params\_type -\>** **?error\_handler:((string \* exn) list -\>** **Xhtml\_types.body\_content Eliom\_content\_core.Xhtml.F.elt list** **Lwt.t) -\>** **('a -\>** **'d -\> Xhtml\_types.body\_content Eliom\_content\_core.Xhtml.F.elt list Lwt.t) -\>** **('a, 'd,** **\[\> \`Attached of** **(\[\> \`Internal of \[\> \`Coservice \] \], \[\> \`Post \]) Eliom\_service.a\_s \],** **'b, 'c, 'e, \[\< Eliom\_service.registrable \> \`Registrable \],** **Eliom\_registration.http\_service)** **Eliom\_service.service**

Same as  **Eliom\_service.post\_coservice** followed by  **Eliom\_registration.Block.register** .

*val register\_post\_coservice'* :  **?scope:\[\< Eliom\_common.scope \] -\>** **?options:unit -\>** **?charset:string -\>** **?code:int -\>** **?content\_type:string -\>** **?headers:Http\_headers.t -\>** **?secure\_session:bool -\>** **?name:string -\>** **?csrf\_safe:bool -\>** **?csrf\_scope:\[\< Eliom\_common.user\_scope \] -\>** **?csrf\_secure:bool -\>** **?max\_use:int -\>** **?timeout:float -\>** **?keep\_get\_na\_params:bool -\>** **?https:bool -\>** **post\_params:('a, \[ \`WithoutSuffix \], 'b) Eliom\_parameter.params\_type -\>** **?error\_handler:((string \* exn) list -\>** **Xhtml\_types.body\_content Eliom\_content\_core.Xhtml.F.elt list** **Lwt.t) -\>** **(unit -\>** **'a -\> Xhtml\_types.body\_content Eliom\_content\_core.Xhtml.F.elt list Lwt.t) -\>** **(unit, 'a, \[\> \`Nonattached of \[\> \`Post \] Eliom\_service.na\_s \],** **\[ \`WithoutSuffix \], unit, 'b, \[\< Eliom\_service.registrable \> \`Registrable \],** **Eliom\_registration.http\_service)** **Eliom\_service.service**

Same as  **Eliom\_service.post\_coservice'** followed by  **Eliom\_registration.Block.register** .

**===** **Low-level function** **===**

*val send* :  **?options:unit -\>** **?charset:string -\>** **?code:int -\>** **?content\_type:string -\>** **?headers:Http\_headers.t -\>** **Xhtml\_types.body\_content Eliom\_content\_core.Xhtml.F.elt list -\>** **(Eliom\_registration.block\_content, Eliom\_registration.http\_service)** **Eliom\_registration.kind Lwt.t**

The function  **send page** build the HTTP frame corresponding to **page** . This may be used for example in an service handler registered with  **Eliom\_registration.Any.register** or when building a custom output module.
