mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-10 04:35:46 -04:00
46 lines
14 KiB
HTML
46 lines
14 KiB
HTML
<!DOCTYPE html>
|
||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Make (cohttp-lwt.Cohttp_lwt.Client.Make)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 3.1.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> – <a href="../../../../index.html">Index</a> » <a href="../../../index.html">cohttp-lwt</a> » <a href="../../index.html">Cohttp_lwt</a> » <a href="../index.html">Client</a> » Make</nav><header class="odoc-preamble"><h1>Module <code><span>Client.Make</span></code></h1></header><div class="odoc-tocs"><nav class="odoc-toc odoc-local-toc"><ul><li><a href="#parameters">Parameters</a></li><li><a href="#signature">Signature</a></li></ul></nav></div><div class="odoc-content"><h2 id="parameters"><a href="#parameters" class="anchor"></a>Parameters</h2><div class="odoc-spec"><div class="spec parameter anchored" id="argument-1-Connection"><a href="#argument-1-Connection" class="anchor"></a><code><span><span class="keyword">module</span> </span><span><a href="argument-1-Connection/index.html">Connection</a></span><span> : <a href="../../S/module-type-Connection/index.html">S.Connection</a></span></code></div></div><h2 id="signature"><a href="#signature" class="anchor"></a>Signature</h2><div class="odoc-spec"><div class="spec type anchored" id="type-ctx"><a href="#type-ctx" class="anchor"></a><code><span><span class="keyword">type</span> ctx</span><span> = <a href="argument-1-Connection/Net/index.html#type-ctx">Connection.Net.ctx</a></span></code></div></div><div class="odoc-include"><div class="spec-doc"><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">ctx</span> <p>If provided, no connection cache is used, but <a href="../../Connection_cache/Make_no_cache/index.html#val-create"><code>Connection_cache.Make_no_cache.create</code></a> is used to resolve uri and create a dedicated connection with <code>ctx</code>.</p></li></ul><p>In most cases you should use the more specific helper calls in the interface rather than invoke this function directly. See <a href="#val-head"><code>head</code></a>, <a href="#val-get"><code>get</code></a> and <a href="#val-post"><code>post</code></a> for some examples.</p></div><details open="open"><summary class="spec include"><code><span><span class="keyword">include</span> <a href="../../../../cohttp/Cohttp/Generic/Client/module-type-S/index.html">Cohttp.Generic.Client.S</a>
|
||
<span class="keyword">with</span> <span><span class="keyword">type</span> <span>'a <a href="../../../../cohttp/Cohttp/Generic/Client/module-type-S/index.html#type-io">io</a></span> = <span><span class="type-var">'a</span> <a href="../../../../lwt/Lwt/index.html#type-t">Lwt.t</a></span></span>
|
||
<span class="keyword">and</span> <span><span class="keyword">type</span> <a href="../../../../cohttp/Cohttp/Generic/Client/module-type-S/index.html#type-body">body</a> = <a href="../../Body/index.html#type-t">Body.t</a></span>
|
||
<span class="keyword">and</span> <span><span class="keyword">type</span> <span>'a <a href="../../../../cohttp/Cohttp/Generic/Client/module-type-S/index.html#type-with_context">with_context</a></span> = <span><span class="optlabel">?ctx</span>:<a href="#type-ctx">ctx</a> <span class="arrow">-></span></span> <span class="type-var">'a</span></span></span></code></summary><div class="odoc-spec"><div class="spec type anchored" id="type-io"><a href="#type-io" class="anchor"></a><code><span><span class="keyword">type</span> <span>'a io</span></span><span> = <span><span class="type-var">'a</span> <a href="../../../../lwt/Lwt/index.html#type-t">Lwt.t</a></span></span></code></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-with_context"><a href="#type-with_context" class="anchor"></a><code><span><span class="keyword">type</span> <span>'a with_context</span></span><span> = <span><span class="optlabel">?ctx</span>:<a href="#type-ctx">ctx</a> <span class="arrow">-></span></span> <span class="type-var">'a</span></span></code></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-body"><a href="#type-body" class="anchor"></a><code><span><span class="keyword">type</span> body</span><span> = <a href="../../Body/index.html#type-t">Body.t</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-map_context"><a href="#val-map_context" class="anchor"></a><code><span><span class="keyword">val</span> map_context : <span><span><span class="type-var">'a</span> <a href="#type-with_context">with_context</a></span> <span class="arrow">-></span></span> <span><span>(<span><span class="type-var">'a</span> <span class="arrow">-></span></span> <span class="type-var">'b</span>)</span> <span class="arrow">-></span></span> <span><span class="type-var">'b</span> <a href="#type-with_context">with_context</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-call"><a href="#val-call" class="anchor"></a><code><span><span class="keyword">val</span> call :
|
||
<span><span>(<span><span class="optlabel">?headers</span>:<a href="../../../../http/Http/Header/index.html#type-t">Http.Header.t</a> <span class="arrow">-></span></span>
|
||
<span><span class="optlabel">?body</span>:<a href="#type-body">body</a> <span class="arrow">-></span></span>
|
||
<span><span class="optlabel">?chunked</span>:bool <span class="arrow">-></span></span>
|
||
<span><a href="../../../../http/Http/Method/index.html#type-t">Http.Method.t</a> <span class="arrow">-></span></span>
|
||
<span><a href="../../../../uri/Uri/index.html#type-t">Uri.t</a> <span class="arrow">-></span></span>
|
||
<span><span>(<a href="../../../../http/Http/Response/index.html#type-t">Http.Response.t</a> * <a href="#type-body">body</a>)</span> <a href="#type-io">io</a></span>)</span>
|
||
<a href="#type-with_context">with_context</a></span></span></code></div><div class="spec-doc"><p><code>call ?headers ?body ?chunked meth uri</code></p><ul class="at-tags"><li class="returns"><span class="at-tag">returns</span> <p><code>(response, response_body)</code> Consume <code>response_body</code> in a timely fashion. Please see <a href="#val-call"><code>call</code></a> about how and why.</p></li></ul><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">chunked</span> <p>use chunked encoding if <code>true</code>. The default is <code>false</code> for compatibility reasons.</p></li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-head"><a href="#val-head" class="anchor"></a><code><span><span class="keyword">val</span> head : <span><span>(<span><span class="optlabel">?headers</span>:<a href="../../../../http/Http/Header/index.html#type-t">Http.Header.t</a> <span class="arrow">-></span></span> <span><a href="../../../../uri/Uri/index.html#type-t">Uri.t</a> <span class="arrow">-></span></span> <span><a href="../../../../http/Http/Response/index.html#type-t">Http.Response.t</a> <a href="#type-io">io</a></span>)</span> <a href="#type-with_context">with_context</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-get"><a href="#val-get" class="anchor"></a><code><span><span class="keyword">val</span> get :
|
||
<span><span>(<span><span class="optlabel">?headers</span>:<a href="../../../../http/Http/Header/index.html#type-t">Http.Header.t</a> <span class="arrow">-></span></span> <span><a href="../../../../uri/Uri/index.html#type-t">Uri.t</a> <span class="arrow">-></span></span> <span><span>(<a href="../../../../http/Http/Response/index.html#type-t">Http.Response.t</a> * <a href="#type-body">body</a>)</span> <a href="#type-io">io</a></span>)</span> <a href="#type-with_context">with_context</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-delete"><a href="#val-delete" class="anchor"></a><code><span><span class="keyword">val</span> delete :
|
||
<span><span>(<span><span class="optlabel">?body</span>:<a href="#type-body">body</a> <span class="arrow">-></span></span>
|
||
<span><span class="optlabel">?chunked</span>:bool <span class="arrow">-></span></span>
|
||
<span><span class="optlabel">?headers</span>:<a href="../../../../http/Http/Header/index.html#type-t">Http.Header.t</a> <span class="arrow">-></span></span>
|
||
<span><a href="../../../../uri/Uri/index.html#type-t">Uri.t</a> <span class="arrow">-></span></span>
|
||
<span><span>(<a href="../../../../http/Http/Response/index.html#type-t">Http.Response.t</a> * <a href="#type-body">body</a>)</span> <a href="#type-io">io</a></span>)</span>
|
||
<a href="#type-with_context">with_context</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-post"><a href="#val-post" class="anchor"></a><code><span><span class="keyword">val</span> post :
|
||
<span><span>(<span><span class="optlabel">?body</span>:<a href="#type-body">body</a> <span class="arrow">-></span></span>
|
||
<span><span class="optlabel">?chunked</span>:bool <span class="arrow">-></span></span>
|
||
<span><span class="optlabel">?headers</span>:<a href="../../../../http/Http/Header/index.html#type-t">Http.Header.t</a> <span class="arrow">-></span></span>
|
||
<span><a href="../../../../uri/Uri/index.html#type-t">Uri.t</a> <span class="arrow">-></span></span>
|
||
<span><span>(<a href="../../../../http/Http/Response/index.html#type-t">Http.Response.t</a> * <a href="#type-body">body</a>)</span> <a href="#type-io">io</a></span>)</span>
|
||
<a href="#type-with_context">with_context</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-put"><a href="#val-put" class="anchor"></a><code><span><span class="keyword">val</span> put :
|
||
<span><span>(<span><span class="optlabel">?body</span>:<a href="#type-body">body</a> <span class="arrow">-></span></span>
|
||
<span><span class="optlabel">?chunked</span>:bool <span class="arrow">-></span></span>
|
||
<span><span class="optlabel">?headers</span>:<a href="../../../../http/Http/Header/index.html#type-t">Http.Header.t</a> <span class="arrow">-></span></span>
|
||
<span><a href="../../../../uri/Uri/index.html#type-t">Uri.t</a> <span class="arrow">-></span></span>
|
||
<span><span>(<a href="../../../../http/Http/Response/index.html#type-t">Http.Response.t</a> * <a href="#type-body">body</a>)</span> <a href="#type-io">io</a></span>)</span>
|
||
<a href="#type-with_context">with_context</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-patch"><a href="#val-patch" class="anchor"></a><code><span><span class="keyword">val</span> patch :
|
||
<span><span>(<span><span class="optlabel">?body</span>:<a href="#type-body">body</a> <span class="arrow">-></span></span>
|
||
<span><span class="optlabel">?chunked</span>:bool <span class="arrow">-></span></span>
|
||
<span><span class="optlabel">?headers</span>:<a href="../../../../http/Http/Header/index.html#type-t">Http.Header.t</a> <span class="arrow">-></span></span>
|
||
<span><a href="../../../../uri/Uri/index.html#type-t">Uri.t</a> <span class="arrow">-></span></span>
|
||
<span><span>(<a href="../../../../http/Http/Response/index.html#type-t">Http.Response.t</a> * <a href="#type-body">body</a>)</span> <a href="#type-io">io</a></span>)</span>
|
||
<a href="#type-with_context">with_context</a></span></span></code></div></div></details></div><div class="odoc-spec"><div class="spec value anchored" id="val-set_cache"><a href="#val-set_cache" class="anchor"></a><code><span><span class="keyword">val</span> set_cache : <span><a href="../../S/index.html#type-call">S.call</a> <span class="arrow">-></span></span> unit</span></code></div><div class="spec-doc"><p>Provide a function used to process requests. Please see <code>call</code>. The provided function is only used when no <code>ctx</code> argument is passed to the convenience functions below.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-post_form"><a href="#val-post_form" class="anchor"></a><code><span><span class="keyword">val</span> post_form :
|
||
<span><span class="optlabel">?ctx</span>:<a href="#type-ctx">ctx</a> <span class="arrow">-></span></span>
|
||
<span><span class="optlabel">?headers</span>:<a href="../../../../http/Http/Header/index.html#type-t">Http.Header.t</a> <span class="arrow">-></span></span>
|
||
<span><span class="label">params</span>:<span><span>(string * <span>string list</span>)</span> list</span> <span class="arrow">-></span></span>
|
||
<span><a href="../../../../uri/Uri/index.html#type-t">Uri.t</a> <span class="arrow">-></span></span>
|
||
<span><span>(<a href="../../../../http/Http/Response/index.html#type-t">Http.Response.t</a> * <a href="../../Body/index.html#type-t">Body.t</a>)</span> <a href="../../../../lwt/Lwt/index.html#type-t">Lwt.t</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-callv"><a href="#val-callv" class="anchor"></a><code><span><span class="keyword">val</span> callv :
|
||
<span><span class="optlabel">?ctx</span>:<a href="#type-ctx">ctx</a> <span class="arrow">-></span></span>
|
||
<span><a href="../../../../uri/Uri/index.html#type-t">Uri.t</a> <span class="arrow">-></span></span>
|
||
<span><span><span>(<a href="../../../../http/Http/Request/index.html#type-t">Http.Request.t</a> * <a href="../../Body/index.html#type-t">Body.t</a>)</span> <a href="../../../../lwt/Lwt_stream/index.html#type-t">Lwt_stream.t</a></span> <span class="arrow">-></span></span>
|
||
<span><span><span>(<a href="../../../../http/Http/Response/index.html#type-t">Http.Response.t</a> * <a href="../../Body/index.html#type-t">Body.t</a>)</span> <a href="../../../../lwt/Lwt_stream/index.html#type-t">Lwt_stream.t</a></span> <a href="../../../../lwt/Lwt/index.html#type-t">Lwt.t</a></span></span></code></div><div class="spec-doc"><ul class="at-tags"><li class="deprecated"><span class="at-tag">deprecated</span> <p>use <a href="../../Connection/index.html"><code>Cohttp_lwt.Connection</code></a> instead.</p></li></ul></div></div></div></body></html>
|