Update post using json api v2

I was using requests wrong. This seems to fix it:

resp = requests.request('put', 'http://localhost:8000/wp-json/wp/v2/posts/8', json=data, auth=HTTPBasicAuth(userid, passwd))

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)