CodeIgniter4/libraries/curlrequest.html
2018-11-16 02:16:56 -08:00

728 lines
52 KiB
HTML

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CURLRequest Class &mdash; CodeIgniter4 4.0.0-alpha.2 documentation</title>
<link rel="shortcut icon" href="../_static/ci-icon.ico"/>
<link rel="stylesheet" href="../_static/css/citheme.css" type="text/css" />
<link rel="top" title="CodeIgniter4 4.0.0-alpha.2 documentation" href="../index.html"/>
<link rel="up" title="Library Reference" href="index.html"/>
<link rel="next" title="Email Class" href="email.html"/>
<link rel="prev" title="Caching Driver" href="caching.html"/>
<script src="../_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="../index.html" class="icon icon-home"> CodeIgniter4
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../intro/index.html">Welcome to CodeIgniter4</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Tutorial</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../concepts/index.html">CodeIgniter4 Overview</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../general/index.html">General Topics</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../incoming/index.html">Controllers and Routing</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../outgoing/index.html">Building Responses</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../database/index.html">Working With Databases</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../models/index.html">Modeling Data</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../dbmgmt/index.html">Managing Databases</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Library Reference</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="caching.html">Caching Driver</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">CURLRequest Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="email.html">Email Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="files.html">Working with Files</a></li>
<li class="toctree-l2"><a class="reference internal" href="honeypot.html">Honeypot Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="images.html">Image Manipulation Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="pagination.html">Pagination</a></li>
<li class="toctree-l2"><a class="reference internal" href="security.html">Security Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="sessions.html">Session Library</a></li>
<li class="toctree-l2"><a class="reference internal" href="throttler.html">Throttler</a></li>
<li class="toctree-l2"><a class="reference internal" href="time.html">Dates and Times</a></li>
<li class="toctree-l2"><a class="reference internal" href="typography.html">Typography</a></li>
<li class="toctree-l2"><a class="reference internal" href="uploaded_files.html">Working with Uploaded Files</a></li>
<li class="toctree-l2"><a class="reference internal" href="uri.html">Working with URIs</a></li>
<li class="toctree-l2"><a class="reference internal" href="user_agent.html">User Agent Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="validation.html">Validation</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../helpers/index.html">Helpers</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../testing/index.html">Testing</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../cli/index.html">Command Line Usage</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../extending/index.html">Extending CodeIgniter</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../license.html">The MIT License (MIT)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../changelogs/index.html">Change Logs</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">CodeIgniter4</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html">Docs</a> &raquo;</li>
<li><a href="index.html">Library Reference</a> &raquo;</li>
<li>CURLRequest Class</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="curlrequest-class">
<h1>CURLRequest Class<a class="headerlink" href="#curlrequest-class" title="Permalink to this headline"></a></h1>
<p>The <code class="docutils literal"><span class="pre">CURLRequest</span></code> class is a lightweight HTTP client based on CURL that allows you to talk to other
web sites and servers. It can be used to get the contents of a Google search, retrieve a web page or image,
or communicate with an API, among many other things.</p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#loading-the-library" id="id1">Loading the Library</a></li>
<li><a class="reference internal" href="#working-with-the-library" id="id2">Working with the Library</a><ul>
<li><a class="reference internal" href="#making-requests" id="id3">Making Requests</a></li>
<li><a class="reference internal" href="#using-responses" id="id4">Using Responses</a></li>
</ul>
</li>
<li><a class="reference internal" href="#request-options" id="id5">Request Options</a><ul>
<li><a class="reference internal" href="#allow-redirects" id="id6">allow_redirects</a></li>
<li><a class="reference internal" href="#auth" id="id7">auth</a></li>
<li><a class="reference internal" href="#body" id="id8">body</a></li>
<li><a class="reference internal" href="#cert" id="id9">cert</a></li>
<li><a class="reference internal" href="#connect-timeout" id="id10">connect_timeout</a></li>
<li><a class="reference internal" href="#cookie" id="id11">cookie</a></li>
<li><a class="reference internal" href="#debug" id="id12">debug</a></li>
<li><a class="reference internal" href="#delay" id="id13">delay</a></li>
<li><a class="reference internal" href="#form-params" id="id14">form_params</a></li>
<li><a class="reference internal" href="#headers" id="id15">headers</a></li>
<li><a class="reference internal" href="#http-errors" id="id16">http_errors</a></li>
<li><a class="reference internal" href="#json" id="id17">json</a></li>
<li><a class="reference internal" href="#multipart" id="id18">multipart</a></li>
<li><a class="reference internal" href="#query" id="id19">query</a></li>
<li><a class="reference internal" href="#timeout" id="id20">timeout</a></li>
<li><a class="reference internal" href="#verify" id="id21">verify</a></li>
<li><a class="reference internal" href="#version" id="id22">version</a></li>
</ul>
</li>
</ul>
</div>
<p>This class is modelled after the <a class="reference external" href="http://docs.guzzlephp.org/en/latest/">Guzzle HTTP Client</a> library since
it is one of the more widely used libraries. Where possible, the syntax has been kept the same so that if
your application needs something a little more powerful than what this library provides, you will have
to change very little to move over to use Guzzle.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This class requires the <a class="reference external" href="http://php.net/manual/en/book.curl.php">cURL Library</a> to be installed
in your version of PHP. This is a very common library that is typically available but not all hosts
will provide it, so please check with your host to verify if you run into problems.</p>
</div>
<div class="section" id="loading-the-library">
<h2><a class="toc-backref" href="#id1">Loading the Library</a><a class="headerlink" href="#loading-the-library" title="Permalink to this headline"></a></h2>
<p>The library can be loaded either manually or through the <a class="reference internal" href="../concepts/services.html"><span class="doc">Services class</span></a>.</p>
<p>To load with the Services class call the <code class="docutils literal"><span class="pre">curlrequest()</span></code> method:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$client</span> <span class="o">=</span> <span class="nx">\Config\Services</span><span class="o">::</span><span class="na">curlrequest</span><span class="p">();</span>
</pre></div>
</div>
<p>You can pass in an array of default options as the first parameter to modify how cURL will handle the request.
The options are described later in this document:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$options</span> <span class="o">=</span> <span class="p">[</span>
<span class="s1">&#39;base_uri&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;http://example.com/api/v1/&#39;</span><span class="p">,</span>
<span class="s1">&#39;timeout&#39;</span> <span class="o">=&gt;</span> <span class="mi">3</span>
<span class="p">];</span>
<span class="nv">$client</span> <span class="o">=</span> <span class="nx">\Config\Services</span><span class="o">::</span><span class="na">curlrequest</span><span class="p">(</span><span class="nv">$options</span><span class="p">);</span>
</pre></div>
</div>
<p>When creating the class manually, you need to pass a few dependencies in. The first parameter is an
instance of the <code class="docutils literal"><span class="pre">Config\App</span></code> class. The second parameter is a URI instance. The third
parameter is a Response object. The fourth parameter is the optional <code class="docutils literal"><span class="pre">$options</span></code> array:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$client</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">\CodeIgniter\HTTP\CURLRequest</span><span class="p">(</span>
<span class="k">new</span> <span class="nx">\Config\App</span><span class="p">(),</span>
<span class="k">new</span> <span class="nx">\CodeIgniter\HTTP\URI</span><span class="p">(),</span>
<span class="k">new</span> <span class="nx">\CodeIgniter\HTTP\Response</span><span class="p">(</span><span class="k">new</span> <span class="nx">\Config\App</span><span class="p">()),</span>
<span class="nv">$options</span>
<span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="working-with-the-library">
<h2><a class="toc-backref" href="#id2">Working with the Library</a><a class="headerlink" href="#working-with-the-library" title="Permalink to this headline"></a></h2>
<p>Working with CURL requests is simply a matter of creating the Request and getting a
<a class="reference internal" href="../outgoing/response.html"><span class="doc">Response object</span></a> back. It is meant to handle the communications. After that
you have complete control over how the information is handled.</p>
<div class="section" id="making-requests">
<h3><a class="toc-backref" href="#id3">Making Requests</a><a class="headerlink" href="#making-requests" title="Permalink to this headline"></a></h3>
<p>Most communication is done through the <code class="docutils literal"><span class="pre">request()</span></code> method, which fires off the request, and then returns
a Response instance to you. This takes the HTTP method, the url and an array of options as the parameters.</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$client</span> <span class="o">=</span> <span class="nx">\Config\Services</span><span class="o">::</span><span class="na">curlrequest</span><span class="p">();</span>
<span class="nv">$response</span> <span class="o">=</span> <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">request</span><span class="p">(</span><span class="s1">&#39;GET&#39;</span><span class="p">,</span> <span class="s1">&#39;https://api.github.com/user&#39;</span><span class="p">,</span> <span class="p">[</span>
<span class="s1">&#39;auth&#39;</span> <span class="o">=&gt;</span> <span class="p">[</span><span class="s1">&#39;user&#39;</span><span class="p">,</span> <span class="s1">&#39;pass&#39;</span><span class="p">]</span>
<span class="p">]);</span>
</pre></div>
</div>
<p>Since the response is an instance of <code class="docutils literal"><span class="pre">CodeIgniter\HTTP\Response</span></code> you have all of the normal information
available to you:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">echo</span> <span class="nv">$response</span><span class="o">-&gt;</span><span class="na">getStatusCode</span><span class="p">();</span>
<span class="k">echo</span> <span class="nv">$response</span><span class="o">-&gt;</span><span class="na">getBody</span><span class="p">();</span>
<span class="k">echo</span> <span class="nv">$response</span><span class="o">-&gt;</span><span class="na">getHeader</span><span class="p">(</span><span class="s1">&#39;Content-Type&#39;</span><span class="p">);</span>
<span class="nv">$language</span> <span class="o">=</span> <span class="nv">$response</span><span class="o">-&gt;</span><span class="na">negotiateLanguage</span><span class="p">([</span><span class="s1">&#39;en&#39;</span><span class="p">,</span> <span class="s1">&#39;fr&#39;</span><span class="p">]);</span>
</pre></div>
</div>
<p>While the <code class="docutils literal"><span class="pre">request()</span></code> method is the most flexible, you can also use the following shortcut methods. They
each take the URL as the first parameter and an array of options as the second:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="o">*</span> <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">get</span><span class="p">(</span><span class="s1">&#39;http://example.com&#39;</span><span class="p">);</span>
<span class="o">*</span> <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">delete</span><span class="p">(</span><span class="s1">&#39;http://example.com&#39;</span><span class="p">);</span>
<span class="o">*</span> <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">head</span><span class="p">(</span><span class="s1">&#39;http://example.com&#39;</span><span class="p">);</span>
<span class="o">*</span> <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">options</span><span class="p">(</span><span class="s1">&#39;http://example.com&#39;</span><span class="p">);</span>
<span class="o">*</span> <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">patch</span><span class="p">(</span><span class="s1">&#39;http://example.com&#39;</span><span class="p">);</span>
<span class="o">*</span> <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">put</span><span class="p">(</span><span class="s1">&#39;http://example.com&#39;</span><span class="p">);</span>
<span class="o">*</span> <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">post</span><span class="p">(</span><span class="s1">&#39;http://example.com&#39;</span><span class="p">);</span>
</pre></div>
</div>
<div class="section" id="base-uri">
<h4>Base URI<a class="headerlink" href="#base-uri" title="Permalink to this headline"></a></h4>
<p>A <code class="docutils literal"><span class="pre">base_uri</span></code> can be set as one of the options during the instantiation of the class. This allows you to
set a base URI, and then make all requests with that client using relative URLs. This is especially handy
when working with APIs:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$client</span> <span class="o">=</span> <span class="nx">\Config\Services</span><span class="o">::</span><span class="na">curlrequest</span><span class="p">([</span>
<span class="s1">&#39;base_uri&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;https://example.com/api/v1/&#39;</span>
<span class="p">]);</span>
<span class="c1">// GET http:example.com/api/v1/photos</span>
<span class="nv">$client</span><span class="o">-&gt;</span><span class="na">get</span><span class="p">(</span><span class="s1">&#39;photos&#39;</span><span class="p">);</span>
<span class="c1">// GET http:example.com/api/v1/photos/13</span>
<span class="nv">$client</span><span class="o">-&gt;</span><span class="na">delete</span><span class="p">(</span><span class="s1">&#39;photos/13&#39;</span><span class="p">);</span>
</pre></div>
</div>
<p>When a relative URI is provided to the <code class="docutils literal"><span class="pre">request()</span></code> method or any of the shortcut methods, it will be combined
with the base_uri according to the rules described by
<a class="reference external" href="http://tools.ietf.org/html/rfc3986#section-5.2">RFC 2986, section 2</a>. To save you some time, here are some
examples of how the combinations are resolved.</p>
<blockquote>
<div><table border="1" class="docutils">
<colgroup>
<col width="35%" />
<col width="25%" />
<col width="40%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">base_uri</th>
<th class="head">URI</th>
<th class="head">Result</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><a class="reference external" href="http://foo.com">http://foo.com</a></td>
<td>/bar</td>
<td><a class="reference external" href="http://foo.com/bar">http://foo.com/bar</a></td>
</tr>
<tr class="row-odd"><td><a class="reference external" href="http://foo.com/foo">http://foo.com/foo</a></td>
<td>/bar</td>
<td><a class="reference external" href="http://foo.com/bar">http://foo.com/bar</a></td>
</tr>
<tr class="row-even"><td><a class="reference external" href="http://foo.com/foo">http://foo.com/foo</a></td>
<td>bar</td>
<td><a class="reference external" href="http://foo.com/bar">http://foo.com/bar</a></td>
</tr>
<tr class="row-odd"><td><a class="reference external" href="http://foo.com/foo/">http://foo.com/foo/</a></td>
<td>bar</td>
<td><a class="reference external" href="http://foo.com/foo/bar">http://foo.com/foo/bar</a></td>
</tr>
<tr class="row-even"><td><a class="reference external" href="http://foo.com">http://foo.com</a></td>
<td><a class="reference external" href="http://baz.com">http://baz.com</a></td>
<td><a class="reference external" href="http://baz.com">http://baz.com</a></td>
</tr>
<tr class="row-odd"><td><a class="reference external" href="http://foo.com/?bar">http://foo.com/?bar</a></td>
<td>bar</td>
<td><a class="reference external" href="http://foo.com/bar">http://foo.com/bar</a></td>
</tr>
</tbody>
</table>
</div></blockquote>
</div>
</div>
<div class="section" id="using-responses">
<h3><a class="toc-backref" href="#id4">Using Responses</a><a class="headerlink" href="#using-responses" title="Permalink to this headline"></a></h3>
<p>Each <code class="docutils literal"><span class="pre">request()</span></code> call returns a Response object that contains a lot of useful information and some helpful
methods. The most commonly used methods let you determine the response itself.</p>
<p>You can get the status code and reason phrase of the response:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$code</span> <span class="o">=</span> <span class="nv">$response</span><span class="o">-&gt;</span><span class="na">getStatusCode</span><span class="p">();</span> <span class="c1">// 200</span>
<span class="nv">$reason</span> <span class="o">=</span> <span class="nv">$response</span><span class="o">-&gt;</span><span class="na">getReason</span><span class="p">();</span> <span class="c1">// OK</span>
</pre></div>
</div>
<p>You can retrieve headers from the response:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="c1">// Get a header line</span>
<span class="k">echo</span> <span class="nv">$response</span><span class="o">-&gt;</span><span class="na">getHeaderLine</span><span class="p">(</span><span class="s1">&#39;Content-Type&#39;</span><span class="p">);</span>
<span class="c1">// Get all headers</span>
<span class="k">foreach</span> <span class="p">(</span><span class="nv">$response</span><span class="o">-&gt;</span><span class="na">getHeaders</span><span class="p">()</span> <span class="k">as</span> <span class="nv">$name</span> <span class="o">=&gt;</span> <span class="nv">$value</span><span class="p">)</span>
<span class="p">{</span>
<span class="k">echo</span> <span class="nv">$name</span> <span class="o">.</span><span class="s1">&#39;: &#39;</span><span class="o">.</span> <span class="nv">$response</span><span class="o">-&gt;</span><span class="na">getHeaderLine</span><span class="p">(</span><span class="nv">$name</span><span class="p">)</span> <span class="o">.</span><span class="s2">&quot;</span><span class="se">\n</span><span class="s2">&quot;</span><span class="p">;</span>
<span class="p">}</span>
</pre></div>
</div>
<p>The body can be retrieved using the <code class="docutils literal"><span class="pre">getBody()</span></code> method:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$body</span> <span class="o">=</span> <span class="nv">$response</span><span class="o">-&gt;</span><span class="na">getBody</span><span class="p">();</span>
</pre></div>
</div>
<p>The body is the raw body provided by the remote getServer. If the content type requires formatting, you will need
to ensure that your script handles that:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="p">(</span><span class="nb">strpos</span><span class="p">(</span><span class="nv">$response</span><span class="o">-&gt;</span><span class="na">getHeader</span><span class="p">(</span><span class="s1">&#39;content-type&#39;</span><span class="p">),</span> <span class="s1">&#39;application/json&#39;</span><span class="p">)</span> <span class="o">!==</span> <span class="k">false</span><span class="p">)</span>
<span class="p">{</span>
<span class="nv">$body</span> <span class="o">=</span> <span class="nb">json_decode</span><span class="p">(</span><span class="nv">$body</span><span class="p">);</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="request-options">
<h2><a class="toc-backref" href="#id5">Request Options</a><a class="headerlink" href="#request-options" title="Permalink to this headline"></a></h2>
<p>This section describes all of the available options you may pass into the constructor, the <code class="docutils literal"><span class="pre">request()</span></code> method,
or any of the shortcut methods.</p>
<div class="section" id="allow-redirects">
<h3><a class="toc-backref" href="#id6">allow_redirects</a><a class="headerlink" href="#allow-redirects" title="Permalink to this headline"></a></h3>
<p>By default, cURL will follow all &#8220;Location:&#8221; headers the remote servers send back. The <code class="docutils literal"><span class="pre">allow_redirects</span></code> option
allows you to modify how that works.</p>
<p>If you set the value to <code class="docutils literal"><span class="pre">false</span></code>, then it will not follow any redirects at all:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$client</span><span class="o">-&gt;</span><span class="na">request</span><span class="p">(</span><span class="s1">&#39;GET&#39;</span><span class="p">,</span> <span class="s1">&#39;http://example.com&#39;</span><span class="p">,</span> <span class="p">[</span><span class="s1">&#39;allow_redirects&#39;</span> <span class="o">=&gt;</span> <span class="k">false</span><span class="p">]);</span>
</pre></div>
</div>
<p>Setting it to <code class="docutils literal"><span class="pre">true</span></code> will apply the default settings to the request:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$client</span><span class="o">-&gt;</span><span class="na">request</span><span class="p">(</span><span class="s1">&#39;GET&#39;</span><span class="p">,</span> <span class="s1">&#39;http://example.com&#39;</span><span class="p">,</span> <span class="p">[</span><span class="s1">&#39;allow_redirects&#39;</span> <span class="o">=&gt;</span> <span class="k">true</span><span class="p">]);</span>
<span class="c1">// Sets the following defaults:</span>
<span class="s1">&#39;max&#39;</span> <span class="o">=&gt;</span> <span class="mi">5</span><span class="p">,</span> <span class="c1">// Maximum number of redirects to follow before stopping</span>
<span class="s1">&#39;strict&#39;</span> <span class="o">=&gt;</span> <span class="k">true</span><span class="p">,</span> <span class="c1">// Ensure POST requests stay POST requests through redirects</span>
<span class="s1">&#39;protocols&#39;</span> <span class="o">=&gt;</span> <span class="p">[</span><span class="s1">&#39;http&#39;</span><span class="p">,</span> <span class="s1">&#39;https&#39;</span><span class="p">]</span> <span class="c1">// Restrict redirects to one or more protocols</span>
</pre></div>
</div>
<p>You can pass in array as the value of the <code class="docutils literal"><span class="pre">allow_redirects</span></code> option to specify new settings in place of the defaults:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$client</span><span class="o">-&gt;</span><span class="na">request</span><span class="p">(</span><span class="s1">&#39;GET&#39;</span><span class="p">,</span> <span class="s1">&#39;http://example.com&#39;</span><span class="p">,</span> <span class="p">[</span><span class="s1">&#39;allow_redirects&#39;</span> <span class="o">=&gt;</span> <span class="p">[</span>
<span class="s1">&#39;max&#39;</span> <span class="o">=&gt;</span> <span class="mi">10</span><span class="p">,</span>
<span class="s1">&#39;protocols&#39;</span> <span class="o">=&gt;</span> <span class="p">[</span><span class="s1">&#39;https&#39;</span><span class="p">]</span> <span class="c1">// Force HTTPS domains only.</span>
<span class="p">]]);</span>
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Following redirects does not work when PHP is in safe_mode or open_basedir is enabled.</p>
</div>
</div>
<div class="section" id="auth">
<h3><a class="toc-backref" href="#id7">auth</a><a class="headerlink" href="#auth" title="Permalink to this headline"></a></h3>
<p>Allows you to provide Authentication details for <a class="reference external" href="http://www.ietf.org/rfc/rfc2069.txt">HTTP Basic</a> and
<a class="reference external" href="http://www.ietf.org/rfc/rfc2069.txt">Digest</a> and authentication. Your script may have to do extra to support
Digest authentication - this simply passes the username and password along for you. The value must be an
array where the first element is the username, and the second is the password. The third parameter should be
the type of authentication to use, either <code class="docutils literal"><span class="pre">basic</span></code> or <code class="docutils literal"><span class="pre">digest</span></code>:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$client</span><span class="o">-&gt;</span><span class="na">request</span><span class="p">(</span><span class="s1">&#39;GET&#39;</span><span class="p">,</span> <span class="s1">&#39;http://example.com&#39;</span><span class="p">,</span> <span class="p">[</span><span class="s1">&#39;auth&#39;</span> <span class="o">=&gt;</span> <span class="p">[</span><span class="s1">&#39;username&#39;</span><span class="p">,</span> <span class="s1">&#39;password&#39;</span><span class="p">,</span> <span class="s1">&#39;digest&#39;</span><span class="p">]]);</span>
</pre></div>
</div>
</div>
<div class="section" id="body">
<h3><a class="toc-backref" href="#id8">body</a><a class="headerlink" href="#body" title="Permalink to this headline"></a></h3>
<p>There are two ways to set the body of the request for request types that support them, like PUT, OR POST.
The first way is to use the <code class="docutils literal"><span class="pre">setBody()</span></code> method:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$client</span><span class="o">-&gt;</span><span class="na">setBody</span><span class="p">(</span><span class="nv">$body</span><span class="p">)</span>
<span class="o">-&gt;</span><span class="na">request</span><span class="p">(</span><span class="s1">&#39;put&#39;</span><span class="p">,</span> <span class="s1">&#39;http://example.com&#39;</span><span class="p">);</span>
</pre></div>
</div>
<p>The second method is by passing a <code class="docutils literal"><span class="pre">body</span></code> option in. This is provided to maintain Guzzle API compatibility,
and functions the exact same way as the previous example. The value must be a string:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$client</span><span class="o">-&gt;</span><span class="na">request</span><span class="p">(</span><span class="s1">&#39;put&#39;</span><span class="p">,</span> <span class="s1">&#39;http://example.com&#39;</span><span class="p">,</span> <span class="p">[</span><span class="s1">&#39;body&#39;</span> <span class="o">=&gt;</span> <span class="nv">$body</span><span class="p">]);</span>
</pre></div>
</div>
</div>
<div class="section" id="cert">
<h3><a class="toc-backref" href="#id9">cert</a><a class="headerlink" href="#cert" title="Permalink to this headline"></a></h3>
<p>To specify the location of a PEM formatted client-side certificate, pass a string with the full path to the
file as the <code class="docutils literal"><span class="pre">cert</span></code> option. If a password is required, set the value to an array with the first element
as the path to the certificate, and the second as the password:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$client</span><span class="o">-&gt;</span><span class="na">request</span><span class="p">(</span><span class="s1">&#39;get&#39;</span><span class="p">,</span> <span class="s1">&#39;/&#39;</span><span class="p">,</span> <span class="p">[</span><span class="s1">&#39;cert&#39;</span> <span class="o">=&gt;</span> <span class="p">[</span><span class="s1">&#39;/path/getServer.pem&#39;</span><span class="p">,</span> <span class="s1">&#39;password&#39;</span><span class="p">]);</span>
</pre></div>
</div>
</div>
<div class="section" id="connect-timeout">
<h3><a class="toc-backref" href="#id10">connect_timeout</a><a class="headerlink" href="#connect-timeout" title="Permalink to this headline"></a></h3>
<p>By default, CodeIgniter does not impose a limit for cURL to attempt to connect to a website. If you need to
modify this value, you can do so by passing the amount of time in seconds with the <code class="docutils literal"><span class="pre">connect_timeout</span></code> option.
You can pass 0 to wait indefinitely:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$response</span><span class="o">-&gt;</span><span class="na">request</span><span class="p">(</span><span class="s1">&#39;GET&#39;</span><span class="p">,</span> <span class="s1">&#39;http://example.com&#39;</span><span class="p">,</span> <span class="p">[</span><span class="s1">&#39;connect_timeout&#39;</span> <span class="o">=&gt;</span> <span class="mi">0</span><span class="p">]);</span>
</pre></div>
</div>
</div>
<div class="section" id="cookie">
<h3><a class="toc-backref" href="#id11">cookie</a><a class="headerlink" href="#cookie" title="Permalink to this headline"></a></h3>
<p>This specifies the filename that CURL should use to read cookie values from, and
to save cookie values to. This is done using the CURL_COOKIEJAR and CURL_COOKIEFILE options.
An example:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$response</span><span class="o">-&gt;</span><span class="na">request</span><span class="p">(</span><span class="s1">&#39;GET&#39;</span><span class="p">,</span> <span class="s1">&#39;http://example.com&#39;</span><span class="p">,</span> <span class="p">[</span><span class="s1">&#39;cookie&#39;</span> <span class="o">=&gt;</span> <span class="nx">WRITEPATH</span> <span class="o">.</span> <span class="s1">&#39;CookieSaver.txt&#39;</span><span class="p">]);</span>
</pre></div>
</div>
</div>
<div class="section" id="debug">
<h3><a class="toc-backref" href="#id12">debug</a><a class="headerlink" href="#debug" title="Permalink to this headline"></a></h3>
<p>When <code class="docutils literal"><span class="pre">debug</span></code> is passed and set to <code class="docutils literal"><span class="pre">true</span></code>, this will enable additional debugging to echo to STDOUT during the
script execution. This is done by passing CURLOPT_VERBOSE and echoing the output:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$response</span><span class="o">-&gt;</span><span class="na">request</span><span class="p">(</span><span class="s1">&#39;GET&#39;</span><span class="p">,</span> <span class="s1">&#39;http://example.com&#39;</span><span class="p">,</span> <span class="p">[</span><span class="s1">&#39;debug&#39;</span> <span class="o">=&gt;</span> <span class="k">true</span><span class="p">]);</span>
</pre></div>
</div>
<p>You can pass a filename as the value for debug to have the output written to a file:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$response</span><span class="o">-&gt;</span><span class="na">request</span><span class="p">(</span><span class="s1">&#39;GET&#39;</span><span class="p">,</span> <span class="s1">&#39;http://example.com&#39;</span><span class="p">,</span> <span class="p">[</span><span class="s1">&#39;debug&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;/usr/local/curl_log.txt&#39;</span><span class="p">]);</span>
</pre></div>
</div>
</div>
<div class="section" id="delay">
<h3><a class="toc-backref" href="#id13">delay</a><a class="headerlink" href="#delay" title="Permalink to this headline"></a></h3>
<p>Allows you to pause a number of milliseconds before sending the request:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="c1">// Delay for 2 seconds</span>
<span class="nv">$response</span><span class="o">-&gt;</span><span class="na">request</span><span class="p">(</span><span class="s1">&#39;GET&#39;</span><span class="p">,</span> <span class="s1">&#39;http://example.com&#39;</span><span class="p">,</span> <span class="p">[</span><span class="s1">&#39;delay&#39;</span> <span class="o">=&gt;</span> <span class="mi">2000</span><span class="p">]);</span>
</pre></div>
</div>
</div>
<div class="section" id="form-params">
<h3><a class="toc-backref" href="#id14">form_params</a><a class="headerlink" href="#form-params" title="Permalink to this headline"></a></h3>
<p>You can send form data in an application/x-www-form-urlencoded POST request by passing an associative array in
the <code class="docutils literal"><span class="pre">form_params</span></code> option. This will set the <code class="docutils literal"><span class="pre">Content-Type</span></code> header to <code class="docutils literal"><span class="pre">application/x-www-form-urlencoded</span></code>
if it&#8217;s not already set:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$client</span><span class="o">-&gt;</span><span class="na">request</span><span class="p">(</span><span class="s1">&#39;POST&#39;</span><span class="p">,</span> <span class="s1">&#39;/post&#39;</span><span class="p">,</span> <span class="p">[</span>
<span class="s1">&#39;form_params&#39;</span> <span class="o">=&gt;</span> <span class="p">[</span>
<span class="s1">&#39;foo&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;bar&#39;</span><span class="p">,</span>
<span class="s1">&#39;baz&#39;</span> <span class="o">=&gt;</span> <span class="p">[</span><span class="s1">&#39;hi&#39;</span><span class="p">,</span> <span class="s1">&#39;there&#39;</span><span class="p">]</span>
<span class="p">]</span>
<span class="p">]);</span>
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last"><code class="docutils literal"><span class="pre">form_params</span></code> cannot be used with the <code class="docutils literal"><span class="pre">multipart</span></code> option. You will need to use one or the other.
Use <code class="docutils literal"><span class="pre">form_params</span></code> for <code class="docutils literal"><span class="pre">application/x-www-form-urlencoded</span></code> request, and <code class="docutils literal"><span class="pre">multipart</span></code> for <code class="docutils literal"><span class="pre">multipart/form-data</span></code>
requests.</p>
</div>
</div>
<div class="section" id="headers">
<h3><a class="toc-backref" href="#id15">headers</a><a class="headerlink" href="#headers" title="Permalink to this headline"></a></h3>
<p>While you can set any headers this request needs by using the <code class="docutils literal"><span class="pre">setHeader()</span></code> method, you can also pass an associative
array of headers in as an option. Each key is the name of a header, and each value is a string or array of strings
representing the header field values:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$client</span><span class="o">-&gt;</span><span class="na">request</span><span class="p">(</span><span class="s1">&#39;get&#39;</span><span class="p">,</span> <span class="s1">&#39;/&#39;</span><span class="p">,</span> <span class="p">[</span>
<span class="s1">&#39;headers&#39;</span> <span class="o">=&gt;</span> <span class="p">[</span>
<span class="s1">&#39;User-Agent&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;testing/1.0&#39;</span><span class="p">,</span>
<span class="s1">&#39;Accept&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;application/json&#39;</span><span class="p">,</span>
<span class="s1">&#39;X-Foo&#39;</span> <span class="o">=&gt;</span> <span class="p">[</span><span class="s1">&#39;Bar&#39;</span><span class="p">,</span> <span class="s1">&#39;Baz&#39;</span><span class="p">]</span>
<span class="p">]</span>
<span class="p">]);</span>
</pre></div>
</div>
<p>If headers are passed into the constructor they are treated as default values that will be overridden later by any
further headers arrays or calls to <code class="docutils literal"><span class="pre">setHeader()</span></code>.</p>
</div>
<div class="section" id="http-errors">
<h3><a class="toc-backref" href="#id16">http_errors</a><a class="headerlink" href="#http-errors" title="Permalink to this headline"></a></h3>
<p>By default, CURLRequest will fail if the HTTP code returned is greater than or equal to 400. You can set
<code class="docutils literal"><span class="pre">http_errors</span></code> to <code class="docutils literal"><span class="pre">false</span></code> to return the content instead:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$client</span><span class="o">-&gt;</span><span class="na">request</span><span class="p">(</span><span class="s1">&#39;GET&#39;</span><span class="p">,</span> <span class="s1">&#39;/status/500&#39;</span><span class="p">);</span>
<span class="c1">// Will fail verbosely</span>
<span class="nv">$res</span> <span class="o">=</span> <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">request</span><span class="p">(</span><span class="s1">&#39;GET&#39;</span><span class="p">,</span> <span class="s1">&#39;/status/500&#39;</span><span class="p">,</span> <span class="p">[</span><span class="s1">&#39;http_errors&#39;</span> <span class="o">=&gt;</span> <span class="k">false</span><span class="p">]);</span>
<span class="k">echo</span> <span class="nv">$res</span><span class="o">-&gt;</span><span class="na">getStatusCode</span><span class="p">();</span>
<span class="c1">// 500</span>
</pre></div>
</div>
</div>
<div class="section" id="json">
<h3><a class="toc-backref" href="#id17">json</a><a class="headerlink" href="#json" title="Permalink to this headline"></a></h3>
<p>The <code class="docutils literal"><span class="pre">json</span></code> option is used to easily upload JSON encoded data as the body of a request. A Content-Type header
of <code class="docutils literal"><span class="pre">application/json</span></code> is added, overwriting any Content-Type that might be already set. The data provided to
this option can be any value that <code class="docutils literal"><span class="pre">json_encode()</span></code> accepts:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$response</span> <span class="o">=</span> <span class="nv">$client</span><span class="o">-&gt;</span><span class="na">request</span><span class="p">(</span><span class="s1">&#39;PUT&#39;</span><span class="p">,</span> <span class="s1">&#39;/put&#39;</span><span class="p">,</span> <span class="p">[</span><span class="s1">&#39;json&#39;</span> <span class="o">=&gt;</span> <span class="p">[</span><span class="s1">&#39;foo&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;bar&#39;</span><span class="p">]]);</span>
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This option does not allow for any customization of the <code class="docutils literal"><span class="pre">json_encode()</span></code> function, or the Content-Type
header. If you need that ability, you will need to encode the data manually, passing it through the <code class="docutils literal"><span class="pre">setBody()</span></code>
method of CURLRequest, and set the Content-Type header with the <code class="docutils literal"><span class="pre">setHeader()</span></code> method.</p>
</div>
</div>
<div class="section" id="multipart">
<h3><a class="toc-backref" href="#id18">multipart</a><a class="headerlink" href="#multipart" title="Permalink to this headline"></a></h3>
<p>When you need to send files and other data via a POST request, you can use the <code class="docutils literal"><span class="pre">multipart</span></code> option, along with
the <a class="reference external" href="http://php.net/manual/en/class.curlfile.php">CURLFile Class</a>. The values should be an associative array
of POST data to send. For safer usage, the legacy method of uploading files by prefixing their name with an <cite>&#64;</cite>
has been disabled. Any files that you want to send must be passed as instances of CURLFile:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$post_data</span> <span class="o">=</span> <span class="p">[</span>
<span class="s1">&#39;foo&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;bar&#39;</span><span class="p">,</span>
<span class="s1">&#39;userfile&#39;</span> <span class="o">=&gt;</span> <span class="k">new</span> <span class="nx">\CURLFile</span><span class="p">(</span><span class="s1">&#39;/path/to/file.txt&#39;</span><span class="p">)</span>
<span class="p">];</span>
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last"><code class="docutils literal"><span class="pre">multipart</span></code> cannot be used with the <code class="docutils literal"><span class="pre">form_params</span></code> option. You can only use one or the other. Use
<code class="docutils literal"><span class="pre">form_params</span></code> for <code class="docutils literal"><span class="pre">application/x-www-form-urlencoded</span></code> requests, and <code class="docutils literal"><span class="pre">multipart</span></code> for <code class="docutils literal"><span class="pre">multipart/form-data</span></code>
requests.</p>
</div>
</div>
<div class="section" id="query">
<h3><a class="toc-backref" href="#id19">query</a><a class="headerlink" href="#query" title="Permalink to this headline"></a></h3>
<p>You can pass along data to send as query string variables by passing an associative array as the <code class="docutils literal"><span class="pre">query</span></code> option:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="c1">// Send a GET request to /get?foo=bar</span>
<span class="nv">$client</span><span class="o">-&gt;</span><span class="na">request</span><span class="p">(</span><span class="s1">&#39;GET&#39;</span><span class="p">,</span> <span class="s1">&#39;/get&#39;</span><span class="p">,</span> <span class="p">[</span><span class="s1">&#39;query&#39;</span> <span class="o">=&gt;</span> <span class="p">[</span><span class="s1">&#39;foo&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;bar&#39;</span><span class="p">]]);</span>
</pre></div>
</div>
</div>
<div class="section" id="timeout">
<h3><a class="toc-backref" href="#id20">timeout</a><a class="headerlink" href="#timeout" title="Permalink to this headline"></a></h3>
<p>By default, cURL functions are allowed to run as long as they take, with no time limit. You can modify this with the <code class="docutils literal"><span class="pre">timeout</span></code>
option. The value should be the number of seconds you want the functions to execute for. Use 0 to wait indefinitely:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="nv">$response</span><span class="o">-&gt;</span><span class="na">request</span><span class="p">(</span><span class="s1">&#39;GET&#39;</span><span class="p">,</span> <span class="s1">&#39;http://example.com&#39;</span><span class="p">,</span> <span class="p">[</span><span class="s1">&#39;timeout&#39;</span> <span class="o">=&gt;</span> <span class="mi">5</span><span class="p">]);</span>
</pre></div>
</div>
</div>
<div class="section" id="verify">
<h3><a class="toc-backref" href="#id21">verify</a><a class="headerlink" href="#verify" title="Permalink to this headline"></a></h3>
<p>This option describes the SSL certificate verification behavior. If the <code class="docutils literal"><span class="pre">verify</span></code> option is <code class="docutils literal"><span class="pre">true</span></code>, it enables the
SSL certificate verification and uses the default CA bundle provided by the operating system. If set to <code class="docutils literal"><span class="pre">false</span></code> it
will disable the certificate verification (this is insecure, and allows man-in-the-middle attacks!). You can set it
to a string that contains the path to a CA bundle to enable verification with a custom certificate. The default value
is true:</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="c1">// Use the system&#39;s CA bundle (this is the default setting)</span>
<span class="nv">$client</span><span class="o">-&gt;</span><span class="na">request</span><span class="p">(</span><span class="s1">&#39;GET&#39;</span><span class="p">,</span> <span class="s1">&#39;/&#39;</span><span class="p">,</span> <span class="p">[</span><span class="s1">&#39;verify&#39;</span> <span class="o">=&gt;</span> <span class="k">true</span><span class="p">]);</span>
<span class="c1">// Use a custom SSL certificate on disk.</span>
<span class="nv">$client</span><span class="o">-&gt;</span><span class="na">request</span><span class="p">(</span><span class="s1">&#39;GET&#39;</span><span class="p">,</span> <span class="s1">&#39;/&#39;</span><span class="p">,</span> <span class="p">[</span><span class="s1">&#39;verify&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;/path/to/cert.pem&#39;</span><span class="p">]);</span>
<span class="c1">// Disable validation entirely. (Insecure!)</span>
<span class="nv">$client</span><span class="o">-&gt;</span><span class="na">request</span><span class="p">(</span><span class="s1">&#39;GET&#39;</span><span class="p">,</span> <span class="s1">&#39;/&#39;</span><span class="p">,</span> <span class="p">[</span><span class="s1">&#39;verify&#39;</span> <span class="o">=&gt;</span> <span class="k">false</span><span class="p">]);</span>
</pre></div>
</div>
</div>
<div class="section" id="version">
<h3><a class="toc-backref" href="#id22">version</a><a class="headerlink" href="#version" title="Permalink to this headline"></a></h3>
<p>To set the HTTP protocol to use, you can pass a string or float with the version number (typically either 1.0
or 1.1, 2.0 is currently unsupported.):</p>
<div class="highlight-ci"><div class="highlight"><pre><span></span><span class="c1">// Force HTTP/1.0</span>
<span class="nv">$client</span><span class="o">-&gt;</span><span class="na">request</span><span class="p">(</span><span class="s1">&#39;GET&#39;</span><span class="p">,</span> <span class="s1">&#39;/&#39;</span><span class="p">,</span> <span class="p">[</span><span class="s1">&#39;version&#39;</span> <span class="o">=&gt;</span> <span class="mf">1.0</span><span class="p">]);</span>
</pre></div>
</div>
</div>
</div>
</div>
</div>
<div class="articleComments">
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="email.html" class="btn btn-neutral float-right" title="Email Class" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="caching.html" class="btn btn-neutral" title="Caching Driver" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2014-2018 British Columbia Institute of Technology.
Last updated on Nov 16, 2018.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../',
VERSION:'4.0.0-alpha.2',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: false,
SOURCELINK_SUFFIX: ''
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="../_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>