/usr/share/doc/python3-pycurl/doc/docstrings
NameSizeModeActions
curl.rst3770644editdlrm
curl_close.rst3190644editdlrm
curl_errstr.rst4650644editdlrm
curl_errstr_raw.rst4440644editdlrm
curl_getinfo.rst32490644editdlrm
curl_getinfo_raw.rst30770644editdlrm
curl_pause.rst3980644editdlrm
curl_perform.rst2200644editdlrm
curl_perform_rb.rst6990644editdlrm
curl_perform_rs.rst10910644editdlrm
curl_reset.rst2760644editdlrm
curl_setopt.rst45910644editdlrm
curl_setopt_string.rst12360644editdlrm
curl_set_ca_certs.rst1440644editdlrm
curl_unsetopt.rst5990644editdlrm
multi.rst1260644editdlrm
multi_add_handle.rst5220644editdlrm
multi_assign.rst2670644editdlrm
multi_close.rst2910644editdlrm
multi_fdset.rst9000644editdlrm
multi_info_read.rst6950644editdlrm
multi_perform.rst2010644editdlrm
multi_remove_handle.rst4350644editdlrm
multi_select.rst7340644editdlrm
multi_setopt.rst14380644editdlrm
multi_socket_action.rst2930644editdlrm
multi_socket_all.rst1230644editdlrm
multi_timeout.rst2020644editdlrm
pycurl_global_cleanup.rst1850644editdlrm
pycurl_global_init.rst3210644editdlrm
pycurl_module.rst4140644editdlrm
pycurl_version_info.rst6560644editdlrm
share.rst2340644editdlrm
share_close.rst3130644editdlrm
share_setopt.rst7650644editdlrm
Edit: /usr/share/doc/python3-pycurl/doc/docstrings/curl_getinfo_raw.rst (3077B)
getinfo_raw(option) -> Result Extract and return information from a curl session, returning string data as byte strings. Corresponds to `curl_easy_getinfo`_ in libcurl. The ``getinfo_raw`` method should not be called unless ``perform`` has been called and finished. *option* is a constant corresponding to one of the ``CURLINFO_*`` constants in libcurl. Most option constant names match the respective ``CURLINFO_*`` constant names with the ``CURLINFO_`` prefix removed, for example ``CURLINFO_CONTENT_TYPE`` is accessible as ``pycurl.CONTENT_TYPE``. Exceptions to this rule are as follows: - ``CURLINFO_FILETIME`` is mapped as ``pycurl.INFO_FILETIME`` - ``CURLINFO_COOKIELIST`` is mapped as ``pycurl.INFO_COOKIELIST`` - ``CURLINFO_CERTINFO`` is mapped as ``pycurl.INFO_CERTINFO`` - ``CURLINFO_RTSP_CLIENT_CSEQ`` is mapped as ``pycurl.INFO_RTSP_CLIENT_CSEQ`` - ``CURLINFO_RTSP_CSEQ_RECV`` is mapped as ``pycurl.INFO_RTSP_CSEQ_RECV`` - ``CURLINFO_RTSP_SERVER_CSEQ`` is mapped as ``pycurl.INFO_RTSP_SERVER_CSEQ`` - ``CURLINFO_RTSP_SESSION_ID`` is mapped as ``pycurl.INFO_RTSP_SESSION_ID`` The type of return value depends on the option, as follows: - Options documented by libcurl to return an integer value return a Python integer (``long`` on Python 2, ``int`` on Python 3). - Options documented by libcurl to return a floating point value return a Python ``float``. - Options documented by libcurl to return a string value return a Python byte string (``str`` on Python 2, ``bytes`` on Python 3). The string contains whatever data libcurl returned. Use :ref:`getinfo ` to retrieve this data as a Unicode string on Python 3. - ``SSL_ENGINES`` and ``INFO_COOKIELIST`` return a list of byte strings. The same encoding caveats apply; use :ref:`getinfo ` to retrieve the data as a list of potentially Unicode strings. - ``INFO_CERTINFO`` returns a list with one element per certificate in the chain, starting with the leaf; each element is a sequence of *(key, value)* tuples where both ``key`` and ``value`` are byte strings. String encoding caveats apply; use :ref:`getinfo ` to retrieve certificate data as potentially Unicode strings. On Python 2, ``getinfo`` and ``getinfo_raw`` behave identically. Example usage:: import pycurl c = pycurl.Curl() c.setopt(pycurl.OPT_CERTINFO, 1) c.setopt(pycurl.URL, "https://python.org") c.setopt(pycurl.FOLLOWLOCATION, 1) c.perform() print(c.getinfo_raw(pycurl.HTTP_CODE)) # --> 200 print(c.getinfo_raw(pycurl.EFFECTIVE_URL)) # --> b"https://www.python.org/" certinfo = c.getinfo_raw(pycurl.INFO_CERTINFO) print(certinfo) # --> [((b'Subject', b'C = AU, ST = Some-State, O = PycURL test suite, CN = localhost'), (b'Issuer', b'C = AU, ST = Some-State, O = PycURL test suite, OU = localhost, CN = localhost'), (b'Version', b'0'), ...)] Raises pycurl.error exception upon failure. *Added in version 7.43.0.2.* .. _curl_easy_getinfo: https://curl.haxx.se/libcurl/c/curl_easy_getinfo.html