Custom headers with pycurl

前端 未结 3 1874
南方客
南方客 2021-02-07 01:38

Can I send a custom header like \"yaddayadda\" to the server with the pycurl request?

3条回答
  •  迷失自我
    2021-02-07 02:17

    I would code something like:

    pycurl_connect = pycurl.Curl()
    pycurl_connect.setopt(pycurl.URL, your_url)
    pycurl_connect.setopt(pycurl.HTTPHEADER, ['header_name1: header_value1',
                                              'header_name2: header_value2'])
    pycurl_connect.perform()
    

提交回复
热议问题