title: How to Loop through payload in python to send data to a server
body: <p>I have a csv file and I want to send each value of the each row in database using payload. What I have tried is </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>for index,row in df.iterrows():
  var1=row['A']
  for index,row in df.iterrows():
  var2=row['B']
  for index,row in df.iterrows():
  var3=row['c']
  url="http://10.67.46.8/api/data/create.php"
  payload='{"A":"'+str(var1)+'","B":"'+str(var2)+'","C":"'+str(var3)+'"}'
  headers={
  'cache-control': "no-cache",
  'Postman-Token':"ca64cf56-19e8-4e6c-85a7-1741355ced79"
  }
  response=request.request("POST",url,data=payload,headers,headers)
  print(response.text)</code></pre>
  </div>
  </div>
  </p>
  
  <p>I want to get each and every value of var1, var2, var3 to pass through payload, but only last value of each variable is passed by the payload. what should I do to make loop on payload. so that it can pass each value to database.</p>