title: Python: How to change variable in http post request
body: <pre><code>data = {'Email':'myemail@gmail.com','Name':'1','Password':'gfgf65jh56456jh67'}
  r = requests.post(url, data=json.dumps(data), headers=headers)
  </code></pre>
  
  <p>Hello,
  I am using above code to send http request and it worked well. However, I want to use for loop to change "Name" variable. So, this is my code after changing</p>
  
  <pre><code>for i in range(1,1000): 
      data = "{'Email':'myemail@gmail.com','Name':'" + str(i) + "','Password':'gfgf65jh56456jh67'}"
      r = requests.post(url, data=json.dumps(data), headers=headers)
  </code></pre>
  
  <p>However, I got an output from server: {'Message': 'An error has occurred.'}. It is not python error. So, how to fix my code ? Thank you :)</p>