Open reachvimalm opened 6 years ago
@reachvimalm , There is some problem with the data you are posting. The API is not able to interpret your data properly. Since you are using python requests module, I suggest using the json keyword when doing a requests.post()
I got such an error from GitHub API when I didn't send any POST data.
I am getting the same error. @reachvimalm @hckr were you able resolve it?
[tkn-task] ←[96mLine |
[tkn-task] ←[96m 72 | ←[0m ←[96mInvoke-RestMethod -Headers $headers -uri $URI -Body $json -Method←[0m …
[tkn-task] ←[96m | ←[91m ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[tkn-task] ←[91m←[96m | ←[91m{"message":"Invalid request.\n\nFor 'links/0/schema', nil is
[tkn-task] ←[96m | ←[91mnot an
[tkn-task] ←[96m | ←[91mobject.","documentation_url":"https://docs.github.com/enterprise/2.22/rest/reference/repos#create-a-commit-comment"}
[tkn-task] ←[0m
I was able to solve it. My request was not correct.
My request also wasn't correct, it lacked message body.
@jothikanth
Hey!! I also have same issue while trying to dispatch the Github Actions via the Github API. Following is my post request:
res = requests.post(url, auth=HTTPBasicAuth(self.username, self.password), params=params)
Following are the message details :
URL = https://api.github.com/repos/amanaation/repo_name/actions/workflows/sampleid123/dispatches
and the credentials. Any help is really appreciated. I am stuck in this issue for hours.
I am getting the following credentials :
RESPONSE : <Response [422]> {'message': "Invalid request.\n\nFor 'links/0/schema', nil is not an object.", 'documentation_url': 'https://docs.github.com/rest/reference/actions#create-a-workflow-dispatch-event'}
I am using REST API to create branch on my fork. but it throws weird error "Invalid request.\n\nFor 'links/0/schema', nil is not an object." I am using python session.post Request
[https://mygit.com/api/v3/repos/vimal/myproj/git/refs] ref [refs/heads/readme] {'Accept-Encoding': 'gzip, deflate', 'Accept': '/', 'User-Agent': 'python-requests/2.18.4', 'sha': u'fc20403521d0bcea35b3b14a3622ffdd5d0359bc', 'Connection': 'keep-alive', 'ref': 'refs/heads/readme', 'Authorization': 'token 123x'}
Response
{u'documentation_url': u'https://developer.github.com/enterprise/2.12/v3/git/refs/#create-a-reference', u'message': u"Invalid request.\n\nFor 'links/0/schema', nil is not an object."}