The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link rel='stylesheet' href='https://metacpan.org/_asset/288683e3285b02987a848283f0f92207' type='text/css'>
<script type='text/javascript' src='https://metacpan.org/_asset/12b19d083bf773523c065d4d729f0327'></script>
</head>
<body>
<div class="pod">


<ul id="index">
  <li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>

<h1 id="DESCRIPTION">DESCRIPTION</h1>

<p>The Transport class manages the request cycle. It receives parsed requests from the (user-facing) client class, and tries to execute the request on a node in the cluster, retrying a request if necessary.</p>

<p>Raw requests can be executed using the transport class as follows:</p>

<pre class="brush: pl; class-name: 'highlight'; toolbar: false; gutter: false">    $result = $e-&gt;transport-&gt;perform_request(
        method =&gt; &#39;POST&#39;,
        path   =&gt; &#39;/_search&#39;,
        qs     =&gt; { from =&gt; 0, size =&gt; 10 },
        body   =&gt; {
            query =&gt; {
                match =&gt; {
                    title =&gt; &quot;Elasticsearch clients&quot;
                }
            }
        }
    );</pre>

<p>Other than the <code>method</code>, <code>path</code>, <code>qs</code> and <code>body</code> parameters, which should be self-explanatory, it also accepts:</p>

<dl>

<dt id="ignore"><code>ignore</code></dt>
<dd>

<p>The HTTP error codes which should be ignored instead of throwing an error, eg <code>404 NOT FOUND</code>:</p>

<pre class="brush: pl; class-name: 'highlight'; toolbar: false; gutter: false">    $result = $e-&gt;transport-&gt;perform_request(
        method =&gt; &#39;GET&#39;,
        path   =&gt; &#39;/index/type/id&#39;
        ignore =&gt; [404],
    );</pre>

</dd>
<dt id="serialize"><code>serialize</code></dt>
<dd>

<p>Whether the <code>body</code> should be serialized in the standard way (as plain JSON) or using the special <i>bulk</i> format: <code>&quot;std&quot;</code> or <code>&quot;bulk&quot;</code>.</p>

</dd>
</dl>


</div>
</body>
</html>