Webs_gateway
Gateway interaction.
Tools for letting the gateway serve files. See this section of the web service howto. To let the service itself send them see Webs_fs
.
val send_file :
header:Webs.Http.Headers.Name.t ->
Webs.Http.Path.fpath ->
(Webs.Http.Response.t, 'e) Stdlib.result
send_file ~header file
is a response that instructs the gateway to serve file file
. Use Webs.Http.Request.to_absolute_filepath
to safely determine a file path from a request.
More precisely this is a Webs.Http.Status.ok_200
empty response with the header field name header
set to file
. The actual header name to use depends on your gateway, see below.
val x_accel_redirect : Webs.Http.Headers.Name.t
x_accel_redirect
is the header name x-accel-redirect
used by nginx for internal redirection.
val x_sendfile : Webs.Http.Headers.Name.t
x_sendfile
is the header name x-sendfile
. Used by Apache and lighttpd for file serving.