Sophie

Sophie

distrib > Mageia > 4 > i586 > by-pkgid > 07ec4e1006689824c37b6ae5b69626c7 > files > 27

ocsigenserver-doc-2.2.0-5.mga4.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<link rel="Start" href="index.html">
<link rel="previous" href="Ocsigen_parseconfig.html">
<link rel="next" href="Ocsigen_local_files.html">
<link rel="Up" href="index.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of class methods" rel=Appendix href="index_methods.html">
<link title="Index of classes" rel=Appendix href="index_classes.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Index of module types" rel=Appendix href="index_module_types.html">
<link title="Ocsigen_cache" rel="Chapter" href="Ocsigen_cache.html">
<link title="Ocsigen_lib_base" rel="Chapter" href="Ocsigen_lib_base.html">
<link title="Ocsigen_lib" rel="Chapter" href="Ocsigen_lib.html">
<link title="Ocsigen_config" rel="Chapter" href="Ocsigen_config.html">
<link title="Ocsigen_getcommandline" rel="Chapter" href="Ocsigen_getcommandline.html">
<link title="Ocsigen_messages" rel="Chapter" href="Ocsigen_messages.html">
<link title="Ocsigen_stream" rel="Chapter" href="Ocsigen_stream.html">
<link title="Ocsigen_loader" rel="Chapter" href="Ocsigen_loader.html">
<link title="Polytables" rel="Chapter" href="Polytables.html">
<link title="Http_headers" rel="Chapter" href="Http_headers.html">
<link title="Ocsigen_http_frame" rel="Chapter" href="Ocsigen_http_frame.html">
<link title="Ocsigen_headers" rel="Chapter" href="Ocsigen_headers.html">
<link title="Framepp" rel="Chapter" href="Framepp.html">
<link title="Ocsigen_http_com" rel="Chapter" href="Ocsigen_http_com.html">
<link title="Ocsigen_charset_mime" rel="Chapter" href="Ocsigen_charset_mime.html">
<link title="Ocsigen_senders" rel="Chapter" href="Ocsigen_senders.html">
<link title="Ocsigen_cookies" rel="Chapter" href="Ocsigen_cookies.html">
<link title="Ocsigen_extensions" rel="Chapter" href="Ocsigen_extensions.html">
<link title="Ocsigen_parseconfig" rel="Chapter" href="Ocsigen_parseconfig.html">
<link title="Ocsigen_http_client" rel="Chapter" href="Ocsigen_http_client.html">
<link title="Ocsigen_local_files" rel="Chapter" href="Ocsigen_local_files.html">
<link title="Ocsigen_server" rel="Chapter" href="Ocsigen_server.html">
<link title="Ocsigen_comet" rel="Chapter" href="Ocsigen_comet.html">
<link title="Accesscontrol" rel="Chapter" href="Accesscontrol.html">
<link title="Authbasic" rel="Chapter" href="Authbasic.html">
<link title="Ocsipersist" rel="Chapter" href="Ocsipersist.html"><title>Ocsigen_http_client</title>
</head>
<body>
<div class="navbar"><a class="pre" href="Ocsigen_parseconfig.html" title="Ocsigen_parseconfig">Previous</a>
&nbsp;<a class="up" href="index.html" title="Index">Up</a>
&nbsp;<a class="post" href="Ocsigen_local_files.html" title="Ocsigen_local_files">Next</a>
</div>
<h1>Module <a href="type_Ocsigen_http_client.html">Ocsigen_http_client</a></h1>

<pre><span class="keyword">module</span> Ocsigen_http_client: <code class="code">sig</code> <a href="Ocsigen_http_client.html">..</a> <code class="code">end</code></pre><div class="info module top">
Using Ocsigen as a HTTP client<br>
</div>
<hr width="100%">

<pre><span id="VALget"><span class="keyword">val</span> get</span> : <code class="type">?https:bool -><br>       ?port:int -><br>       ?headers:<a href="Http_headers.html#TYPEt">Http_headers.t</a> -><br>       host:string -> uri:string -> unit -> <a href="Ocsigen_http_frame.html#TYPEt">Ocsigen_http_frame.t</a> Lwt.t</code></pre><div class="info ">
Do a GET HTTP request.
    The default port is 80 for HTTP, 443 for HTTPS.
    The default protocol is http (<code class="code">https=false</code>).
<p>

    Warning: the stream must be finalized manually after reading, using
    <a href="Ocsigen_stream.html#VALfinalize"><code class="code">Ocsigen_stream.finalize</code></a>, otherwise you will have fd leaks.<br>
</div>

<pre><span id="VALget_url"><span class="keyword">val</span> get_url</span> : <code class="type">?headers:<a href="Http_headers.html#TYPEt">Http_headers.t</a> -> string -> <a href="Ocsigen_http_frame.html#TYPEt">Ocsigen_http_frame.t</a> Lwt.t</code></pre><div class="info ">
Do a GET HTTP request. The string must be a full URL. 
<p>

    Warning: the stream must be finalized manually after reading, using
    <a href="Ocsigen_stream.html#VALfinalize"><code class="code">Ocsigen_stream.finalize</code></a>, otherwise you will have fd leaks.<br>
</div>

<pre><span id="VALpost_string"><span class="keyword">val</span> post_string</span> : <code class="type">?https:bool -><br>       ?port:int -><br>       ?headers:<a href="Http_headers.html#TYPEt">Http_headers.t</a> -><br>       host:string -><br>       uri:string -><br>       content:string -><br>       content_type:string * string -> unit -> <a href="Ocsigen_http_frame.html#TYPEt">Ocsigen_http_frame.t</a> Lwt.t</code></pre><div class="info ">
Do a POST HTTP request.
    The default port is 80 for HTTP, 443 for HTTPS.
    The default protocol is http (<code class="code">https=false</code>).
<p>

    Warning: the stream must be finalized manually after reading, using
    <a href="Ocsigen_stream.html#VALfinalize"><code class="code">Ocsigen_stream.finalize</code></a>, otherwise you will have fd leaks.<br>
</div>

<pre><span id="VALpost_string_url"><span class="keyword">val</span> post_string_url</span> : <code class="type">?headers:<a href="Http_headers.html#TYPEt">Http_headers.t</a> -><br>       content:string -><br>       content_type:string * string -> string -> <a href="Ocsigen_http_frame.html#TYPEt">Ocsigen_http_frame.t</a> Lwt.t</code></pre><div class="info ">
Do a GET HTTP request. The string must be a full URL. 
<p>

    Warning: the stream must be finalized manually after reading, using
    <a href="Ocsigen_stream.html#VALfinalize"><code class="code">Ocsigen_stream.finalize</code></a>, otherwise you will have fd leaks.<br>
</div>

<pre><span id="VALpost_urlencoded"><span class="keyword">val</span> post_urlencoded</span> : <code class="type">?https:bool -><br>       ?port:int -><br>       ?headers:<a href="Http_headers.html#TYPEt">Http_headers.t</a> -><br>       host:string -><br>       uri:string -><br>       content:(string * string) list -> unit -> <a href="Ocsigen_http_frame.html#TYPEt">Ocsigen_http_frame.t</a> Lwt.t</code></pre><div class="info ">
Do a POST HTTP request with URL encoded parameters as content.
    The default port is 80 for HTTP, 443 for HTTPS.
    The default protocol is http (<code class="code">https=false</code>).
<p>

    Warning: the stream must be finalized manually after reading, using
    <a href="Ocsigen_stream.html#VALfinalize"><code class="code">Ocsigen_stream.finalize</code></a>, otherwise you will have fd leaks.<br>
</div>

<pre><span id="VALpost_urlencoded_url"><span class="keyword">val</span> post_urlencoded_url</span> : <code class="type">?headers:<a href="Http_headers.html#TYPEt">Http_headers.t</a> -><br>       content:(string * string) list -> string -> <a href="Ocsigen_http_frame.html#TYPEt">Ocsigen_http_frame.t</a> Lwt.t</code></pre><div class="info ">
Do a GET HTTP request with URL encoded parameters as content.
    The string must be a full URL. 
<p>

    Warning: the stream must be finalized manually after reading, using
    <a href="Ocsigen_stream.html#VALfinalize"><code class="code">Ocsigen_stream.finalize</code></a>, otherwise you will have fd leaks.<br>
</div>

<pre><span id="VALraw_request"><span class="keyword">val</span> raw_request</span> : <code class="type">?client:<a href="Ocsigen_extensions.html#TYPEclient">Ocsigen_extensions.client</a> -><br>       ?keep_alive:bool -><br>       ?headers:<a href="Http_headers.html#TYPEt">Http_headers.t</a> -><br>       ?https:bool -><br>       ?port:int -><br>       content:string <a href="Ocsigen_stream.html#TYPEt">Ocsigen_stream.t</a> option -><br>       ?content_length:int64 -><br>       http_method:<a href="Ocsigen_http_frame.Http_header.html#TYPEhttp_method">Ocsigen_http_frame.Http_header.http_method</a> -><br>       host:string -><br>       inet_addr:Unix.inet_addr -><br>       uri:string -> unit -> unit -> <a href="Ocsigen_http_frame.html#TYPEt">Ocsigen_http_frame.t</a> Lwt.t</code></pre><div class="info ">
Do an HTTP request (low level).
<p>

   If the optional argument <code class="code">headers</code> is present, no headers will be
   added by Ocsigen, but those in this argument and host, and
   <code class="code">connection: close</code> or <code class="code">connection: keep-alive</code>.
   Be carefull to respect HTTP/1.1 in this case!
   (<code class="code">host</code> is the full Host HTTP field to send).
<p>

   The default port is 80 for HTTP, 443 for HTTPS.
<p>

   The default protocol is http (<code class="code">https=false</code>).
<p>

   The optional parameter <code class="code">~keep_alive</code> asks to keep the connection opened
   after the request for a short amount of time
   to allow other requests to the same server to use the same connection.
   It is true by default.
   If there is one opened free connection, we will use it instead of opening
   a new one.
<p>

   If you do this request to serve it later to a client or to generate a page
   for a client, add the optional parameter <code class="code">~client</code>.
   Thus, the request you do will be pipelined
   with other requests coming from the same connection.
   A request will never be pipelined after a request from another client
   connection.
   Pipelining will be used only for requests to server we know supporting it
   (according to previous requests).
   It is recommended to specify this optional parameter for all requests
   (with the value found in field
   <code class="code">ri_client</code> of type <a href="Ocsigen_extensions.html#TYPErequest_info"><code class="code">Ocsigen_extensions.request_info</code></a>).
<p>

   The optional parameter <code class="code">?head</code> asks to do a <code class="code">HEAD</code> HTTP request.
   It is <code class="code">false</code> by default.
<p>

   When called without the last parameter, the function will pipeline
   the request (if needed), then return the function to get the page.
   This allows to keep pipeline order when writing an extension.<br>
</div>

<pre><span id="VALbasic_raw_request"><span class="keyword">val</span> basic_raw_request</span> : <code class="type">?headers:<a href="Http_headers.html#TYPEt">Http_headers.t</a> -><br>       ?https:bool -><br>       ?port:int -><br>       content:string <a href="Ocsigen_stream.html#TYPEt">Ocsigen_stream.t</a> option -><br>       ?content_length:int64 -><br>       http_method:<a href="Ocsigen_http_frame.Http_header.html#TYPEhttp_method">Ocsigen_http_frame.Http_header.http_method</a> -><br>       host:string -><br>       inet_addr:Unix.inet_addr -> uri:string -> unit -> <a href="Ocsigen_http_frame.html#TYPEt">Ocsigen_http_frame.t</a> Lwt.t</code></pre><div class="info ">
Same as <a href="Ocsigen_http_client.html#VALraw_request"><code class="code">Ocsigen_http_client.raw_request</code></a>, 
    but does not try to reuse connections.
    Opens a new connections for each request. Far less efficient.<br>
</div>
</body></html>