title: Publish WordPress Post with Python Requests and REST API
body: <p>I try to publish post to WordPress blog with python requests and rest api by following code:</p>
  
  <pre><code>auth = 'Basic ' + str(base64.b64encode(b'admin:123456'), 'utf-8')
  headers = {'Authorization': auth}
  body = {'title': 'Hello World'}
  r = requests.post('wp-json/wp/v2/posts', headers=headers, data=body)
  </code></pre>
  
  <p>and always got 401 error:</p>
  
  <pre><code>&gt;&gt;&gt; r.text
  '{"code":"rest_cannot_create","message":"Sorry, you are not allowed to create posts as this user.","data":{"status":401}}'
  </code></pre>
  
  <p>I'm pretty sure that the account admin and password is correct and has administrator role, Did I miss anything?</p>