How to give GitHub a url with a port number when creating a webhook -
i want use github webhooks, github stripping away port number urls give it, don't work. seems new thing because used work. there way tell github keep port numbers in there?
note: i'm creating webhooks via api
i don't think port number stripped away.
post https://api.github.com/repos/my-name/my-repo/hooks
with body:
{ "name": "web", "active": true, "events": [ "push", "pull_request" ], "config": { "url": "http://example.com:345/webhook", "content_type": "json" } }
creates webhook:
btw, on page github renders url without port number.
but if click "edit" button:
the port number presented.
the same you'll if execute
get https://api.github.com/repos/my-name/my-repo/hooks { "url": "https://api.github.com/repos/my-name/my-repo/hooks/7221574", "test_url": "https://api.github.com/repos/my-name/my-repo/hooks/7221574/test", "ping_url": "https://api.github.com/repos/my-name/my-repo/hooks/7221574/pings", "id": 7221574, "name": "web", "active": true, "events": [ "push", "pull_request" ], "config": { "url": "http://example.com:345/webhook", "content_type": "json" }, "last_response": { "code": 504, "status": "timeout", "message": "service timeout", }, "updated_at": "2016-02-08t09:37:45z", "created_at": "2016-02-08t09:37:45z" } }
make sure that:
- you post valid url
- body valid json
- you have rights create webhook
- you can create simple client (postman, advanced rest client)
- your github client library doesn't remove port number
Comments
Post a Comment