I used this https://github.com/orgs/community/discussions/24723 as reference on how to update repositires. While trying to do that I encountered some errors.
The response of the code below is
400
{"message":"Problems parsing JSON","documentation_url":"https://docs.github.com/rest/repos/contents#create-or-update-file-contents","status":"400"}
Code:
headers = {
'accept': 'application/vnd.github+json',
'Authorization': f"Bearer {TOKEN}",
'merge_commit_message' :'Formulated questions',
'merge_commit_title': 'Updating Worksheets'
}
# data = {
# 'name': 'Worksheets',
# 'description': 'Using Github API',
# 'private':'false',
# }
# response = httpx.get(url, params=params_)
# print(response.text)
response = httpx.put(url, headers=headers, content=example_data)
Now I do not know why it can't parse the json despite my(or at least I think so) data dictionary arising directly from github docs.
https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#update-a-repository
If you have any idea on how to fix this problem, it would be great. Thanks