title: Unable to call an API and get respective output in Python
body: <p>I am new to python and I am trying to call an API and get output, however, I am running into the following error:</p>
  
  <blockquote>
    <p>UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8f in position
    2: invalid start byte</p>
  </blockquote>
  
  <p>The code I have written thus far is as follows:</p>
  
  <pre><code>import requests
  file = open("NLPData/testimg.png")
  payload = {file}
  response = requests.get("http://sampleapi.com/get", params=payload)
  print(response.text)
  </code></pre>