# curl - pydoc - phpman

> **TLDR:** Transfers data from or to a server.
>
- Make an HTTP GET request and dump the contents in `stdout`:
  `curl {{https://example.com}}`
- Make an HTTP GET request, follow any `3xx` redirects, and dump the reply headers and contents to `stdout`:
  `curl {{-L|--location}} {{-D|--dump-header}} - {{https://example.com}}`
- Download a file, saving the output under the filename indicated by the URL:
  `curl {{-O|--remote-name}} {{https://example.com/filename.zip}}`
- Send form-encoded data (POST request of type `application/x-www-form-urlencoded`). Use `--data @file_name` or `--data @'-'` to read from `stdin`:
  `curl {{-X|--request}} POST {{-d|--data}} '{{name=bob}}' {{http://example.com/form}}`
- Send a request with an extra header, using a custom HTTP method and over a proxy (such as BurpSuite), ignoring insecure self-signed certificates:
  `curl {{-k|--insecure}} {{-x|--proxy}} {{http://127.0.0.1:8080}} {{-H|--header}} '{{Authorization: Bearer token}}' {{-X|--request}} {{GET|PUT|POST|DELETE|PATCH|...}} {{https://example.com}}`
- Send data in JSON format, specifying the appropriate Content-Type header:
  `curl {{-d|--data}} '{{{"name":"bob"}}}' {{-H|--header}} '{{Content-Type: application/json}}' {{http://example.com/users/1234}}`
- Pass client certificate and private key for the request, skipping certificate validation:
  `curl {{-E|--cert}} {{client.pem}} --key {{key.pem}} {{-k|--insecure}} {{https://example.com}}`
- Resolve a hostname to a custom IP address, with verbose output (similar to editing the `/etc/hosts` file for custom DNS resolution):
  `curl {{-v|--verbose}} --resolve {{example.com}}:{{80}}:{{127.0.0.1}} {{http://example.com}}`

*Source: tldr-pages*

---

Help on package curl:

## NAME
    curl - A high-level interface to the pycurl extension

## PACKAGE CONTENTS


## CLASSES
    builtins.object
        Curl

### class Curl
     |  Curl(base_url='', fakeheaders=None)
     |
     |  High-level interface to pycurl functions.
     |
     |  Methods defined here:
     |
     |  __del__(self)
     |
     |  __init__(self, base_url='', fakeheaders=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  answered(self, check)
     |      Did a given check string occur in the last payload?
     |
     |  body(self)
     |      Return the body from the last response.
     |
     |  close(self)
     |      Close a session, freeing resources.
     |
     |  get(self, url='', params=None)
     |      Ship a GET request for a specified URL, capture the response.
     |
     |  get_info(self, *args)
     |      Get information about retrieval.
     |
     |  head(self, url='', params=None)
     |      Ship a HEAD request for a specified URL, capture the response.
     |
     |  header(self)
     |      Return the header from the last response.
     |
     |  info(self)
     |      Return a dictionary with all info on the last response.
     |
     |  post(self, cgi, params)
     |      Ship a POST request to a specified CGI, capture the response.
     |
     |  set_option(self, *args)
     |      Set an option on the retrieval.
     |
     |  set_timeout(self, timeout)
     |      Set timeout for a retrieving an object
     |
     |  set_url(self, url)
     |      Set the base URL to be retrieved.
     |
     |  set_verbosity(self, level)
     |      Set verbosity to 1 to see transactions.
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |
     |  __dict__
     |      dictionary for instance variables (if defined)
     |
     |  __weakref__
     |      list of weak references to the object (if defined)

## DATA
    SIGPIPE = <Signals.SIGPIPE: 13>
    SIG_IGN = <Handlers.SIG_IGN: 1>
    py3 = True

## FILE
    /usr/lib/python3/dist-packages/curl/__init__.py


