title: How to call an API using Python Requests library
body: <p>I can't figure out how to call this api correctly using python urllib or requests.</p>
  
  <p>Let me give you the code I have now:</p>
  
  <pre><code>import requests
  url = "http://api.cortical.io:80/rest/expressions/similar_terms?retina_name=en_associative&amp;start_index=0&amp;max_results=1&amp;sparsity=1.0&amp;get_fingerprint=false"
  params = {"positions":[0,6,7,29]}
  headers = { "api-key" : key,
              "Content-Type" : "application/json"}
  # Make a get request with the parameters.
  response = requests.get(url, params=params, headers=headers)
  
  # Print the content of the response
  print(response.content)
  </code></pre>
  
  <p>I've even added in the rest of the parameters to the params variable:</p>
  
  <pre><code>url = 'http://api.cortical.io:80/rest/expressions/similar_terms?'
  params = {
      "retina_name":"en_associative",
      "start_index":0,
      "max_results":1,
      "sparsity":1.0,
      "get_fingerprint":False,
      "positions":[0,6,7,29]}
  </code></pre>
  
  <p>I get this message back:</p>
  
  <blockquote>
    <p>An internal server error has been logged @ Sun Apr 01 00:03:02 UTC
    2018</p>
  </blockquote>
  
  <p>So I'm not sure what I'm doing wrong. You can test out their api here, but even with testing I can't figure it out. If I go out to <a href="http://api.cortical.io/" rel="nofollow noreferrer">http://api.cortical.io/</a>, click on the <strong>Expression</strong> tab, click on the <strong>POST /expressions/similar_terms</strong> option then paste {"positions":[0,6,7,29]} in the body textbox and hit the button, it'll give you a valid response, so nothing is wrong with their API.</p>
  
  <p>I don't know what I'm doing wrong. can you help me?</p>