Python3 uses requests library to carry out post account password request data method

  • 2021-01-06 00:40:18
  • OfStack

As shown below:

import urllib,json,requests
url = ''
headers = {}
data = {'username':'asd','pwd':'123456$'}
request =, data=data,json=True . headers=headers)
response = request.content.decode()
# Those that need to carry the request header can all be written in headers Inside, data Is the request body, need to carry additional information can also be added 
#1 Under normal circumstances, you can successfully request the return value 

If the request fails, it is a cross-domain problem or a parameter error.

Related articles: