1
I am trying to log in to gitlab using python requests library but is showing the error (The change you requested was Rejected (422))
Note. I cannot use any external library(Selenium, bs4, mechanizer).
Obs2. I removed the login and password from Data for security reasons.
follows code from below:
import requests
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36',
'Accept-Language': 'pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7',
}
data = {
'utf8': '\u2713',
'authenticity_token': '1iTsnSyWPBSq21gKe5_z',
'user[login]': 'login',
'user[password]': 'senha',
}
response = requests.post('https://gitlab.com/users/sign_in',
headers=headers, data=data)
print(response.content)