{
    "mode": "pydoc",
    "parameter": "curl",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/pydoc/curl/json",
    "generated": "2026-06-02T15:52:35Z",
    "sections": {
        "NAME": {
            "content": "curl - A high-level interface to the pycurl extension\n",
            "subsections": []
        },
        "PACKAGE CONTENTS": {
            "content": "",
            "subsections": []
        },
        "CLASSES": {
            "content": "builtins.object\nCurl\n",
            "subsections": [
                {
                    "name": "class Curl",
                    "content": "|  Curl(baseurl='', fakeheaders=None)\n|\n|  High-level interface to pycurl functions.\n|\n|  Methods defined here:\n|\n|  del(self)\n|\n|  init(self, baseurl='', fakeheaders=None)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  answered(self, check)\n|      Did a given check string occur in the last payload?\n|\n|  body(self)\n|      Return the body from the last response.\n|\n|  close(self)\n|      Close a session, freeing resources.\n|\n|  get(self, url='', params=None)\n|      Ship a GET request for a specified URL, capture the response.\n|\n|  getinfo(self, *args)\n|      Get information about retrieval.\n|\n|  head(self, url='', params=None)\n|      Ship a HEAD request for a specified URL, capture the response.\n|\n|  header(self)\n|      Return the header from the last response.\n|\n|  info(self)\n|      Return a dictionary with all info on the last response.\n|\n|  post(self, cgi, params)\n|      Ship a POST request to a specified CGI, capture the response.\n|\n|  setoption(self, *args)\n|      Set an option on the retrieval.\n|\n|  settimeout(self, timeout)\n|      Set timeout for a retrieving an object\n|\n|  seturl(self, url)\n|      Set the base URL to be retrieved.\n|\n|  setverbosity(self, level)\n|      Set verbosity to 1 to see transactions.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  dict\n|      dictionary for instance variables (if defined)\n|\n|  weakref\n|      list of weak references to the object (if defined)\n"
                }
            ]
        },
        "DATA": {
            "content": "SIGPIPE = <Signals.SIGPIPE: 13>\nSIGIGN = <Handlers.SIGIGN: 1>\npy3 = True\n",
            "subsections": []
        },
        "FILE": {
            "content": "/usr/lib/python3/dist-packages/curl/init.py\n\n",
            "subsections": []
        }
    },
    "summary": "curl - A high-level interface to the pycurl extension",
    "flags": [],
    "examples": [],
    "see_also": [],
    "tldr": {
        "source": "official",
        "description": "Transfers data from or to a server.",
        "examples": [
            {
                "description": "Make an HTTP GET request and dump the contents in `stdout`",
                "command": "curl {{https://example.com}}"
            },
            {
                "description": "Make an HTTP GET request, follow any `3xx` redirects, and dump the reply headers and contents to `stdout`",
                "command": "curl {{-L|--location}} {{-D|--dump-header}} - {{https://example.com}}"
            },
            {
                "description": "Download a file, saving the output under the filename indicated by the URL",
                "command": "curl {{-O|--remote-name}} {{https://example.com/filename.zip}}"
            },
            {
                "description": "Send form-encoded data (POST request of type `application/x-www-form-urlencoded`). Use `--data @file_name` or `--data @'-'` to read from `stdin`",
                "command": "curl {{-X|--request}} POST {{-d|--data}} '{{name=bob}}' {{http://example.com/form}}"
            },
            {
                "description": "Send a request with an extra header, using a custom HTTP method and over a proxy (such as BurpSuite), ignoring insecure self-signed certificates",
                "command": "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}}"
            },
            {
                "description": "Send data in JSON format, specifying the appropriate Content-Type header",
                "command": "curl {{-d|--data}} '{{{\"name\":\"bob\"}}}' {{-H|--header}} '{{Content-Type: application/json}}' {{http://example.com/users/1234}}"
            },
            {
                "description": "Pass client certificate and private key for the request, skipping certificate validation",
                "command": "curl {{-E|--cert}} {{client.pem}} --key {{key.pem}} {{-k|--insecure}} {{https://example.com}}"
            },
            {
                "description": "Resolve a hostname to a custom IP address, with verbose output (similar to editing the `/etc/hosts` file for custom DNS resolution)",
                "command": "curl {{-v|--verbose}} --resolve {{example.com}}:{{80}}:{{127.0.0.1}} {{http://example.com}}"
            }
        ]
    }
}