I would do something like this.
import requests
headers = {
"User-Agent": "some user agent",
"Content-Length": 27
# you get the point
data = {
"targetUser" : "12345"
url = "www.website.com/user/follow"
r = requests.post(url, headers=headers,data=data)
是的,你会使用cookies来登录。Cookies是头文件的一部分。