все. Я хочу отправить новые проблемы с python на Github. Но я не хочу использовать github api. И я принимаю 422 ошибку. Возможно у моего метода есть проблема. Я не знаю . Вы можете помочь мне. Я новичок о Python.
import requests
from bs4 import BeautifulSoup
with requests.Session() as s:
url = "https://github.com/session"
r = s.get(url, headers=headers)
soup = BeautifulSoup(r.content, "lxml")
login_data['authenticity_token'] = soup.find("input", attrs={"name": "authenticity_token"})['value']
r = s.post(url, data=login_data, headers=headers)
url2 = "https://github.com/sadikizgi/dribbbleClonOnRails/issues"
r2 = s.get(url2)
soup2 = BeautifulSoup(r2.content, "lxml")
issue_data['authenticity_token'] = soup2.find("input", attrs={"name": "authenticity_token"})['value']
issue_data['timestamp'] = soup2.find("input", attrs={"name": "timestamp"})['value']
issue_data['timestamp_secret'] = soup2.find("input", attrs={"name": "timestamp_secret"})['value']
r2 = s.post(url2, data=issue_data, headers=headers)
print(issue_data)
print(r2.status_code)