6.8 SoupServerCallback

Callback: SoupServerCallback

A procedure given for it is called as (procedure server msg path query).

A callback used to handle requests to a Server.

path and query contain the likewise-named components of the Request-URI, subject to certain assumptions. By default, Server decodes all percent-encoding in the URI path, such that "/foo%2Fbar" is treated the same as "/foo/bar". If your server is serving resources in some non-POSIX-filesystem namespace, you may want to distinguish those as two distinct paths. In that case, you can set the Server:raw-paths property when creating the Server, and it will leave those characters undecoded.

query contains the query component of the Request-URI parsed according to the rules for HTML form handling. Although this is the only commonly-used query string format in HTTP, there is nothing that actually requires that HTTP URIs use that format; if your server needs to use some other format, you can just ignore query, and call Message.get_uri and parse the URI’s query field yourself.

See Server.add_handler and Server.add_early_handler for details of what handlers can/should do.

server

Passed: a <SoupServer>.

the <SoupServer>

msg

Passed: a <SoupServerMessage>.

the message being processed

path

Passed: a string.

the path component of msg’s Request-URI

query

Passed: a hash table, each key a string and each value a string, or #f.

the parsed query component of msg’s Request-URI

user-data

Not passed: it is the user data that guile-gi supplied.

the data passed to Server.add_handler or Server.add_early_handler.