title: Python requests: How to PUT a string in body?
body: <p>I need to PUT data from a string (no dict) as the body of the call to a REST API.<br>
  When I call</p>
  
  <pre><code>r = requests.put(url, data = string)
  </code></pre>
  
  <p>then I can see in <code>r.request.body</code> after this call that it is <code>None</code>. Also, the server responds with a "411 Length Required" error.</p>
  
  <p>However, when I try it with a dict instead of a string then it works, as the server responds with the correct JSON data. Moreover, in that case I can see in <code>r.request.body</code> the correct data.</p>
  
  <p>Any ideas?</p>
  
  <p>PS: I am using Python 2.7.3 and Python-requests 1.2.0</p>