title: translate curl query to requests
body: <p>I was trying to get hand on using documentation at:
  <a href="https://pairbulkdata.uspto.gov/#/api-documentation" rel="nofollow noreferrer">https://pairbulkdata.uspto.gov/#/api-documentation</a></p>
  
  <p>However when I tried those query, I got error message.
  I am trying to translate curl query to python requests.</p>
  
  <pre><code>curl -i -X POST -H "Content-Type:application/json" -d '{"searchText":"medicine AND diabetes","qf": "patentTitle"}' http://pairbulkdata.uspto.gov/queries
  </code></pre>
  
  <p>Here is the python code that I am trying:</p>
  
  <pre><code>import requests
  
  data = {"searchText":"medicine AND diabetes","qf": "patentTitle"}
  
  url = "http://pairbulkdata.uspto.gov/queries"
  
  header = {"Content-Type":"application/json"}
  
  r = requests.post(url, data = data, headers=header)
  </code></pre>
  
  <p>But I get error.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;\n&lt;HTML&gt;&lt;HEAD&gt;&lt;META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"&gt;\n&lt;TITLE&gt;ERROR: The request could not be satisfied&lt;/TITLE&gt;\n&lt;/HEAD&gt;&lt;BODY&gt;\n&lt;H1&gt;ERROR&lt;/H1&gt;\n&lt;H2&gt;The request could not be satisfied.&lt;/H2&gt;\n&lt;HR noshade size="1px"&gt;\nBad request.\n&lt;BR clear="all"&gt;\n&lt;HR noshade size="1px"&gt;\n&lt;PRE&gt;\nGenerated by cloudfront (CloudFront)\nRequest ID: OIhwX7a3zVJq04M_qf0sjWhuke3fHb1-6wFJsN7UX_Rp2w_gzebTGA==\n&lt;/PRE&gt;\n&lt;ADDRESS&gt;\n&lt;/ADDRESS&gt;\n&lt;/BODY&gt;&lt;/HTML&gt;</code></pre>
  </div>
  </div>
  </p>