GET method in Webhook

madlord's Avatar

madlord

01 Feb, 2017 06:49 AM

How to use GET method instead POST in Webhooks?

  1. Support Staff 1 Posted by Marcin Kuzminsk... on 01 Feb, 2017 09:12 AM

    Marcin Kuzminski's Avatar

    Hi,

    Becuase of the undefined data sent via webhooks the only method is POST, can you tell us the usecase for GET ?

    P.S. Please consider joining our Slack community channel under https://rhodecode.com/join . Get access to our development team as well as community members always willing to help.

  2. 2 Posted by madlord on 01 Feb, 2017 09:57 AM

    madlord's Avatar

    > can you tell us the usecase for GET ?
    I try integrate RC with Jenkins and i need send GET request like 'http://<jenkins>/job/<name>/buildWithParameters?token=<token>'. If i use POST request Jenkins get error 'No valid crumb was included in the request'. If i use GET request - all ok.

  3. Support Staff 3 Posted by Marcin Kuzminsk... on 01 Feb, 2017 10:34 AM

    Marcin Kuzminski's Avatar

    I see, yes it makes sense to add acheckbox to set GET or POST ! we;ll do that.

    Until then i can tell you which code to change to make requests be sent as GET if you like.

  4. 4 Posted by madlord on 01 Feb, 2017 10:40 AM

    madlord's Avatar

    > i can tell you which code to change to make requests be sent as GET if you like.
    Yes, please

  5. Support Staff 5 Posted by Marcin Kuzminsk... on 01 Feb, 2017 11:09 AM

    Marcin Kuzminski's Avatar

    Open the file:

    vim ~/.rccontrol/enterprise-1/profile/etc/rhodecode_enterprise_ce_source/lib/python2.7/site-packages/rhodecode/integrations/types/webhook.py

    change:
    resp = req_session.post(url, json={

    to

    resp = req_session.get(url, json={

  6. 6 Posted by madlord on 02 Feb, 2017 06:10 AM

    madlord's Avatar

    it works, thanks. But webhook.py i found in:
    /opt/rhodecode/store/cgg0ln7k2xdn96xi5kp8phzl5320aay9-python2.7-rhodecode-enterprise-ce-4.5.2/lib/python2.7/site-packages/rhodecode/integrations/types

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

23 Nov, 2017 03:02 PM
21 Nov, 2017 06:38 PM
03 Oct, 2017 08:26 PM
03 Oct, 2017 05:48 PM
28 Sep, 2017 05:55 PM