<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->transport->perform_request(
method => 'POST',
path => '/_search',
qs => { from => 0, size => 10 },
body => {
query => {
match => {
title => "Elasticsearch clients"
}
}
}
);</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->transport->perform_request(
method => 'GET',
path => '/index/type/id'
ignore => [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>"std"</code> or <code>"bulk"</code>.</p>
</dd>
</dl>
</div>
</body>
</html>