title: Argument to a function only if variable is not None
body: <p>I would like to add headers or data as arguments to <code>request.post()</code> only if headers or data is available. What is the cleanest pythonic way of doing this?</p>
  <pre><code>def req( url, headers=None, data=None): 
      if &quot;form-urlencoded&quot; in headers[&quot;Content-Type&quot;]:
          data = data.encode('utf-8')
      return requests.post(
          url,
          headers = headers,
          data = data,
      )
  </code></pre>