[0cf85fa] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect2 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[432ea40] | 7 | <!ENTITY requests-download-http "https://github.com/psf/requests/releases/download/v&requests-version;/requests-&requests-version;.tar.gz">
|
---|
| 8 | <!ENTITY requests-download-ftp " ">
|
---|
| 9 | <!ENTITY requests-md5sum "796ea875cdae283529c03b9203d9c454">
|
---|
| 10 | <!ENTITY requests-size "107 KB">
|
---|
| 11 | <!ENTITY requests-buildsize "2.6 MB">
|
---|
| 12 | <!ENTITY requests-time "less than 0.1 SBU">
|
---|
[0cf85fa] | 13 | ]>
|
---|
| 14 |
|
---|
[432ea40] | 15 | <sect2 id="requests" xreflabel="requests-&requests-version;">
|
---|
[0cf85fa] | 16 |
|
---|
[432ea40] | 17 | <title>Requests-&requests-version;</title>
|
---|
[0cf85fa] | 18 |
|
---|
[432ea40] | 19 | <indexterm zone="requests">
|
---|
| 20 | <primary sortas="a-requests">requests</primary>
|
---|
[0cf85fa] | 21 | </indexterm>
|
---|
| 22 |
|
---|
| 23 | <sect3 role="package">
|
---|
[432ea40] | 24 | <title>Introduction to Requests Module</title>
|
---|
[0cf85fa] | 25 |
|
---|
| 26 | <para>
|
---|
[432ea40] | 27 | The <application>Requests</application> package is an elegant and
|
---|
| 28 | simple HTTP library for Python, built for human beings. It allows
|
---|
| 29 | sending HTTP/1.1 requests extremely easily.
|
---|
[0cf85fa] | 30 | </para>
|
---|
| 31 |
|
---|
| 32 | &lfs112_checked;
|
---|
| 33 |
|
---|
| 34 | <bridgehead renderas="sect4">Package Information</bridgehead>
|
---|
| 35 | <itemizedlist spacing="compact">
|
---|
| 36 | <listitem>
|
---|
| 37 | <para>
|
---|
[432ea40] | 38 | Download (HTTP): <ulink url="&requests-download-http;"/>
|
---|
[0cf85fa] | 39 | </para>
|
---|
| 40 | </listitem>
|
---|
| 41 | <listitem>
|
---|
| 42 | <para>
|
---|
[432ea40] | 43 | Download (FTP): <ulink url="&requests-download-ftp;"/>
|
---|
[0cf85fa] | 44 | </para>
|
---|
| 45 | </listitem>
|
---|
| 46 | <listitem>
|
---|
| 47 | <para>
|
---|
[432ea40] | 48 | Download MD5 sum: &requests-md5sum;
|
---|
[0cf85fa] | 49 | </para>
|
---|
| 50 | </listitem>
|
---|
| 51 | <listitem>
|
---|
| 52 | <para>
|
---|
[432ea40] | 53 | Download size: &requests-size;
|
---|
[0cf85fa] | 54 | </para>
|
---|
| 55 | </listitem>
|
---|
| 56 | <listitem>
|
---|
| 57 | <para>
|
---|
[432ea40] | 58 | Estimated disk space required: &requests-buildsize;
|
---|
[0cf85fa] | 59 | </para>
|
---|
| 60 | </listitem>
|
---|
| 61 | <listitem>
|
---|
| 62 | <para>
|
---|
[432ea40] | 63 | Estimated build time: &requests-time;
|
---|
[0cf85fa] | 64 | </para>
|
---|
| 65 | </listitem>
|
---|
| 66 | </itemizedlist>
|
---|
| 67 |
|
---|
[432ea40] | 68 | <bridgehead renderas="sect4">Requests Dependencies</bridgehead>
|
---|
[0cf85fa] | 69 |
|
---|
[432ea40] | 70 | <bridgehead renderas="sect5">Required</bridgehead>
|
---|
| 71 | <para role="required">
|
---|
| 72 | <xref linkend="certifi"/>,
|
---|
| 73 | <xref linkend="charset-normalizer"/>,
|
---|
| 74 | <xref linkend="idna"/>, and
|
---|
| 75 | <xref linkend="urllib3"/>
|
---|
[0cf85fa] | 76 | </para>
|
---|
| 77 |
|
---|
[114f6db9] | 78 | <bridgehead renderas="sect5">Optional</bridgehead>
|
---|
| 79 | <para role="optional">
|
---|
| 80 | <ulink url="https://pypi.org/project/PySocks/">PySocks</ulink> (also needed for testing)
|
---|
| 81 | </para>
|
---|
| 82 |
|
---|
| 83 | <bridgehead renderas="sect5">Optional (for testing)</bridgehead>
|
---|
| 84 | <para role="optional">
|
---|
| 85 | <xref linkend="pytest"/>,
|
---|
| 86 | <ulink url="https://pypi.org/project/Flask/">Flask</ulink><2,
|
---|
| 87 | <ulink url="https://pypi.org/project/httpbin/">httpbin</ulink>,
|
---|
| 88 | <ulink url="https://pypi.org/project/MarkupSafe/">MarkupSafe</ulink><2.1,
|
---|
| 89 | <ulink url="https://pypi.org/project/pytest-mock/">pytest-mock</ulink>,
|
---|
| 90 | <ulink url="https://pypi.org/project/pytest-httpbin/">pytest-httpbin</ulink>,
|
---|
| 91 | <ulink url="https://pypi.org/project/trustme/">trustme</ulink>, and
|
---|
| 92 | <ulink url="https://pypi.org/project/Werkzeug/">Werkzeug</ulink><2
|
---|
| 93 | </para>
|
---|
| 94 |
|
---|
[0cf85fa] | 95 | </sect3>
|
---|
| 96 |
|
---|
| 97 | <sect3 role="installation">
|
---|
[432ea40] | 98 | <title>Installation of Requests</title>
|
---|
[0cf85fa] | 99 |
|
---|
| 100 | <para> Build the module: </para>
|
---|
| 101 |
|
---|
| 102 | <screen><userinput>pip3 wheel -w dist --no-build-isolation --no-deps $PWD</userinput></screen>
|
---|
| 103 |
|
---|
| 104 | <para>
|
---|
[114f6db9] | 105 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
[0cf85fa] | 106 | </para>
|
---|
| 107 |
|
---|
[114f6db9] | 108 | <screen role="root"><userinput>pip3 install --no-index --find-links dist --no-cache-dir --no-user requests</userinput></screen>
|
---|
| 109 |
|
---|
[0cf85fa] | 110 | <para>
|
---|
[114f6db9] | 111 | Assuming <xref linkend="pytest"/> is installed, but the other optional
|
---|
| 112 | dependencies are not, the installation can be tested with the following
|
---|
| 113 | commands:
|
---|
[0cf85fa] | 114 | </para>
|
---|
| 115 |
|
---|
[114f6db9] | 116 | <screen remap="test"><userinput>python3 -m venv --system-site-packages testenv &&
|
---|
| 117 | source testenv/bin/activate &&
|
---|
| 118 | pip3 install pytest-mock \
|
---|
| 119 | werkzeug\<2 \
|
---|
| 120 | flask\<2 \
|
---|
| 121 | pytest-httpbin \
|
---|
| 122 | pysocks \
|
---|
| 123 | trustme &&
|
---|
| 124 | pip3 install --force-reinstall Markupsafe\<2.1 &&
|
---|
| 125 | python3 /usr/bin/pytest tests &&
|
---|
| 126 | deactivate</userinput></screen>
|
---|
[0cf85fa] | 127 |
|
---|
| 128 | </sect3>
|
---|
| 129 |
|
---|
| 130 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
| 131 | href="../../../xincludes/pip3-cmd-explain.xml"/>
|
---|
| 132 |
|
---|
| 133 | <sect3 role="content">
|
---|
| 134 | <title>Contents</title>
|
---|
| 135 |
|
---|
| 136 | <segmentedlist>
|
---|
| 137 | <segtitle>Installed Programs</segtitle>
|
---|
| 138 | <segtitle>Installed Libraries</segtitle>
|
---|
| 139 | <segtitle>Installed Directories</segtitle>
|
---|
| 140 |
|
---|
| 141 | <seglistitem>
|
---|
[432ea40] | 142 | <seg>None</seg>
|
---|
[0cf85fa] | 143 | <seg>None</seg>
|
---|
| 144 | <seg>
|
---|
[432ea40] | 145 | /usr/lib/python&python3-majorver;/site-packages/requests and
|
---|
| 146 | /usr/lib/python&python3-majorver;/site-packages/requests-&requests-version;.dist-info
|
---|
[0cf85fa] | 147 | </seg>
|
---|
| 148 | </seglistitem>
|
---|
| 149 | </segmentedlist>
|
---|
[432ea40] | 150 |
|
---|
[0cf85fa] | 151 | </sect3>
|
---|
| 152 |
|
---|
| 153 | </sect2>
|
---|