title: Python Requests: How to set optional and non-optional parameters at the same time?
body: <p>I want to query my database with an API.</p>
  
  <p>I have:</p>
  
  <pre><code>import requests
  query_params = {'author':'grisham','year':'1998'}
  response = requests.get(url='http://111.111.1.1:1000',params=query_params)
  </code></pre>
  
  <p>This works fine, I can return a data frame of all the books with author grisham published in the year 1998.</p>
  
  <p>However, I want to amend this to say 'author is a compulsory parameter, but the year may optionally be added as a second parameter' (to differentiate for those who just want all his books, versus those who want to know what he published in one particular year).</p>
  
  <p>I can't seem to find in the requests library, instead of params, can i change this to two dictionaries, optional and compulsory params, and pass them in separately? Or is there a better way to do this?</p>
  
  <p>I guess <a href="https://stackoverflow.com/questions/46282018/pass-optional-parameters-to-http-parameter-python-requests">this</a> is sort of what I'm looking for, wondering if there is something more pythonic/efficient/cleaner for my use case?</p>