title: How to send a bunch of dataframe records to an API using PySpark
body: <p>How to batch send dataframe tuples to an API.</p>
  
  <pre><code>headers = {
      'Content-Type': 'application/json',
      'Accept': '*/*'
  }
  
  data = {"some_key": "some_value", "another_key": "another_value" }
  r = requests.post('https://api.somewhere/batch', params={}, headers=headers, json=data)
  </code></pre>
  
  <p>If the JSON payload is from a DataFrame in PySpark, how can I take advantage of Spark to batch process this currently single threaded approach?</p>