title: Adding a query parameter in python for Bitbucket's API
body: <p>I'm not sure where to implement the query parameter for <code>async</code> in this python code. I don't have a development background and to the extent that I write code as part of my job, it's not python.</p>
  <p>The context is that I am using Zapier to automate our CI/CD and Zapier has a timeout of 10 seconds, which a bitbucket merge seemingly always exceeds. So, I need to force an immediate 202 response rather than wait. The <a href="https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-merge-post" rel="nofollow noreferrer">bitbucket api docs</a> state:</p>
  <p><a href="https://i.stack.imgur.com/iJrFu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iJrFu.png" alt="Bitbucket API docs for merging pull requests with the async query parameter" /></a></p>
  <p>...but I'm not sure where to put that. My code is below, with <code>?q=async=true</code> added to the end of the URL. Prior to this addition, it's been tested as completely functional (minus the timeout issue). It's quite difficult to test this in Zapier outside of an in-flight deployment, so I wanted to run it past the community before trying.</p>
  <pre><code>import requests
  from requests.auth import HTTPBasicAuth
  import json
  
  
  payload = json.dumps({&quot;pullrequest_merge_parameters&quot;:
                        {&quot;type&quot;: &quot;merge&quot;,
                         &quot;message&quot;: &quot;Automated Merge to master on UAT validation&quot;,
                         &quot;close_source_branch&quot;: &quot;false&quot;,
                         &quot;merge_strategy&quot;: [&quot;merge_commit&quot;]}
                        })
  
  auth_string = HTTPBasicAuth(&quot;username&quot;, &quot;password&quot;)
  r = requests.post(&quot;https://api.bitbucket.org/2.0/repositories/workspace/repo/pullrequests/&quot; + input_data[&quot;pull_request_id&quot;] + &quot;/merge?q=async=true&quot;,
                    auth=auth_string,
                    headers={&quot;Content-Type&quot;: &quot;application/json&quot;},
                    data=payload)
  </code></pre>