<spanid="composer-http-client-module"></span><h2>composer.http_client module<aclass="headerlink"href="#module-composer.http_client"title="Permalink to this headline">¶</a></h2>
<dlclass="function">
<dtid="composer.http_client.api_url">
<codeclass="descclassname">composer.http_client.</code><codeclass="descname">api_url</code><spanclass="sig-paren">(</span><em>api_version</em>, <em>url</em><spanclass="sig-paren">)</span><aclass="reference internal"href="_modules/composer/http_client.html#api_url"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#composer.http_client.api_url"title="Permalink to this definition">¶</a></dt>
<dd><p>Return the versioned path to the API route</p>
<li><strong>api_version</strong> (<aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#str"title="(in Python v3.7)"><em>str</em></a>) – The version of the API to talk to. eg. “0”</li>
<li><strong>url</strong> (<aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#str"title="(in Python v3.7)"><em>str</em></a>) – The API route to talk to</li>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><pclass="first">The full url to use for the route and API version</p>
<codeclass="descclassname">composer.http_client.</code><codeclass="descname">append_query</code><spanclass="sig-paren">(</span><em>url</em>, <em>query</em><spanclass="sig-paren">)</span><aclass="reference internal"href="_modules/composer/http_client.html#append_query"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#composer.http_client.append_query"title="Permalink to this definition">¶</a></dt>
<dd><p>Add a query argument to a URL</p>
<p>The query should be of the form “param1=what&param2=ever”, i.e., no
leading ‘?’. The new query data will be appended to any existing
<li><strong>url</strong> (<aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#str"title="(in Python v3.7)"><em>str</em></a>) – The original URL</li>
<li><strong>query</strong> (<aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#str"title="(in Python v3.7)"><em>str</em></a>) – The query to append</li>
</ul>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><pclass="first">The new URL with the query argument included</p>
<codeclass="descclassname">composer.http_client.</code><codeclass="descname">delete_url_json</code><spanclass="sig-paren">(</span><em>socket_path</em>, <em>url</em><spanclass="sig-paren">)</span><aclass="reference internal"href="_modules/composer/http_client.html#delete_url_json"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#composer.http_client.delete_url_json"title="Permalink to this definition">¶</a></dt>
<dd><p>Send a DELETE request to the url and return JSON response</p>
<li><strong>socket_path</strong> (<aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#str"title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
<codeclass="descclassname">composer.http_client.</code><codeclass="descname">download_file</code><spanclass="sig-paren">(</span><em>socket_path</em>, <em>url</em>, <em>progress=True</em><spanclass="sig-paren">)</span><aclass="reference internal"href="_modules/composer/http_client.html#download_file"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#composer.http_client.download_file"title="Permalink to this definition">¶</a></dt>
<dd><p>Download a file, saving it to the CWD with the included filename</p>
<li><strong>socket_path</strong> (<aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#str"title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
<li><strong>url</strong> (<aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#str"title="(in Python v3.7)"><em>str</em></a>) – URL to send POST to</li>
<codeclass="descclassname">composer.http_client.</code><codeclass="descname">get_filename</code><spanclass="sig-paren">(</span><em>headers</em><spanclass="sig-paren">)</span><aclass="reference internal"href="_modules/composer/http_client.html#get_filename"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#composer.http_client.get_filename"title="Permalink to this definition">¶</a></dt>
<dd><p>Get the filename from the response header</p>
<codeclass="descclassname">composer.http_client.</code><codeclass="descname">get_url_json</code><spanclass="sig-paren">(</span><em>socket_path</em>, <em>url</em><spanclass="sig-paren">)</span><aclass="reference internal"href="_modules/composer/http_client.html#get_url_json"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#composer.http_client.get_url_json"title="Permalink to this definition">¶</a></dt>
<dd><p>Return the JSON results of a GET request</p>
<li><strong>socket_path</strong> (<aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#str"title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
<li><strong>url</strong> (<aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#str"title="(in Python v3.7)"><em>str</em></a>) – URL to request</li>
<codeclass="descclassname">composer.http_client.</code><codeclass="descname">get_url_json_unlimited</code><spanclass="sig-paren">(</span><em>socket_path</em>, <em>url</em>, <em>total_fn=None</em><spanclass="sig-paren">)</span><aclass="reference internal"href="_modules/composer/http_client.html#get_url_json_unlimited"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#composer.http_client.get_url_json_unlimited"title="Permalink to this definition">¶</a></dt>
<dd><p>Return the JSON results of a GET request</p>
<p>For URLs that use offset/limit arguments, this command will
<li><strong>socket_path</strong> (<aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#str"title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
<li><strong>url</strong> (<aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#str"title="(in Python v3.7)"><em>str</em></a>) – URL to request</li>
</ul>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><pclass="first">The json response from the server</p>
<codeclass="descclassname">composer.http_client.</code><codeclass="descname">get_url_raw</code><spanclass="sig-paren">(</span><em>socket_path</em>, <em>url</em><spanclass="sig-paren">)</span><aclass="reference internal"href="_modules/composer/http_client.html#get_url_raw"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#composer.http_client.get_url_raw"title="Permalink to this definition">¶</a></dt>
<dd><p>Return the raw results of a GET request</p>
<li><strong>socket_path</strong> (<aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#str"title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
<li><strong>url</strong> (<aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#str"title="(in Python v3.7)"><em>str</em></a>) – URL to request</li>
<codeclass="descclassname">composer.http_client.</code><codeclass="descname">post_url</code><spanclass="sig-paren">(</span><em>socket_path</em>, <em>url</em>, <em>body</em><spanclass="sig-paren">)</span><aclass="reference internal"href="_modules/composer/http_client.html#post_url"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#composer.http_client.post_url"title="Permalink to this definition">¶</a></dt>
<li><strong>socket_path</strong> (<aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#str"title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
<li><strong>url</strong> (<aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#str"title="(in Python v3.7)"><em>str</em></a>) – URL to send POST to</li>
<li><strong>body</strong> (<aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#str"title="(in Python v3.7)"><em>str</em></a>) – The data for the body of the POST</li>
<codeclass="descclassname">composer.http_client.</code><codeclass="descname">post_url_json</code><spanclass="sig-paren">(</span><em>socket_path</em>, <em>url</em>, <em>body</em><spanclass="sig-paren">)</span><aclass="reference internal"href="_modules/composer/http_client.html#post_url_json"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#composer.http_client.post_url_json"title="Permalink to this definition">¶</a></dt>
<li><strong>socket_path</strong> (<aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#str"title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
<li><strong>url</strong> (<aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#str"title="(in Python v3.7)"><em>str</em></a>) – URL to send POST to</li>
<li><strong>body</strong> (<aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#str"title="(in Python v3.7)"><em>str</em></a>) – The data for the body of the POST</li>
<codeclass="descclassname">composer.http_client.</code><codeclass="descname">post_url_toml</code><spanclass="sig-paren">(</span><em>socket_path</em>, <em>url</em>, <em>body</em><spanclass="sig-paren">)</span><aclass="reference internal"href="_modules/composer/http_client.html#post_url_toml"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#composer.http_client.post_url_toml"title="Permalink to this definition">¶</a></dt>
<li><strong>socket_path</strong> (<aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#str"title="(in Python v3.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
<li><strong>url</strong> (<aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#str"title="(in Python v3.7)"><em>str</em></a>) – URL to send POST to</li>
<li><strong>body</strong> (<aclass="reference external"href="https://docs.python.org/3/library/stdtypes.html#str"title="(in Python v3.7)"><em>str</em></a>) – The data for the body of the POST</li>
<spanid="composer-unix-socket-module"></span><h2>composer.unix_socket module<aclass="headerlink"href="#module-composer.unix_socket"title="Permalink to this headline">¶</a></h2>
<dlclass="class">
<dtid="composer.unix_socket.UnixHTTPConnection">
<emclass="property">class </em><codeclass="descclassname">composer.unix_socket.</code><codeclass="descname">UnixHTTPConnection</code><spanclass="sig-paren">(</span><em>socket_path</em>, <em>timeout=60</em><spanclass="sig-paren">)</span><aclass="reference internal"href="_modules/composer/unix_socket.html#UnixHTTPConnection"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#composer.unix_socket.UnixHTTPConnection"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">connect</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="_modules/composer/unix_socket.html#UnixHTTPConnection.connect"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#composer.unix_socket.UnixHTTPConnection.connect"title="Permalink to this definition">¶</a></dt>
<dd><p>Connect to the host and port specified in __init__.</p>
<emclass="property">class </em><codeclass="descclassname">composer.unix_socket.</code><codeclass="descname">UnixHTTPConnectionPool</code><spanclass="sig-paren">(</span><em>socket_path</em>, <em>timeout=60</em><spanclass="sig-paren">)</span><aclass="reference internal"href="_modules/composer/unix_socket.html#UnixHTTPConnectionPool"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#composer.unix_socket.UnixHTTPConnectionPool"title="Permalink to this definition">¶</a></dt>
Built with <ahref="http://sphinx-doc.org/">Sphinx</a> using a <ahref="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <ahref="https://readthedocs.org">Read the Docs</a>.