Trying do post request using python
Question: I'm trying to make http post request using python. Also I need `totp`
authentication and for this I'm using `pyotp`. For the request I'm using
Requests library. But the code doesn't work and I don't know where the mistake
is. Do you have ideas? I'm using python 3.5.

This is the code:

    
    
    import requests
    import json
    from requests.auth import HTTPDigestAuth
    import pyotp
    
    totp = pyotp.TOTP('base32secret3232')
    
    url = 'http://3425325325664364345365'
    
    datas = {
    "github_url": "https://gist.github.com/323332/333333",
    "contact_email": "354353634643@gmail.com"
    }
    
    headers = {
    'Accept': '*/*',
    'Content-Length': '134',
    'Content-Type': 'application/json',
    'Host': '45654645654756456457547547',}
    
    AUTH = HTTPDigestAuth('57457457447547@gmail.com4575475745745', 'totp')
    
    r = requests.post(url, json = datas, headers = headers, auth = AUTH)
    
    print (r.status_code)
    

This is the error:

[![enter image description
here](http://i.stack.imgur.com/28jej.jpg)](http://i.stack.imgur.com/28jej.jpg)

This is the second error:

[![enter image description
here](http://i.stack.imgur.com/CLL9A.png)](http://i.stack.imgur.com/CLL9A.png)


Answer: After I read your question 1 more time I've realized that I missed the last
part.

I might be wrong because I've never used this package but you are using python
3.5 but `pyotp` only supports 2.7 -->
[pypi](https://pypi.python.org/pypi/pyotp)

