Support for HTTP POST for build trigger?
Presently, it seems like TeamCity only supports HTTP GET for build triggers. However, several online VCS sites support "Webhooks" that typically only do HTTP POST to a url. Is there any way to get TeamCity to work with HTTP POST requests?
Please sign in to leave a comment.
Have you tried to use POST? Actually POST requests for triggering build should work too.
Hi Pavel, thanks for your reply. It looks like the POST gets through to the TeamCity web server, however the query string is not coming with it. I've attached my log line from the logs\localhost_access_log_<date>.log file:
75.101.133.212 - - [07/Apr/2009:16:47:50 -0500] "POST /httpAuth/action.html HTTP/1.1" 200 -
As you can see, the POST came through, but without the rest of the URL. In Assembla, I've configured their Webhook to point to my server using forms based authentication and the following path: httpAuth/action.html?add2Queue=bt2
Maybe there is some trouble in translating the query string? I'm not sure..
Mike
With POST request parameters should not be passed via URL. I do not know what online service you are using but I think if it supports POST requests there should be a way to specify parameters for this POST request too. So you should use URL:
/httpAuth/action.html
and add parameter "dd2Queue" with value "bt2"
Hi Pavel, this makes a lot more sense now. The last problem to solve is how to get Assembla to post form data. They allow the POST request to have 4 different MIME types:
- application/xml
- application/json
- text/html
- text/plain
Which of these should I be using in order to get the TeamCity web server to understand the request? What would the content of the message look like with the respective MIME type?
Thanks,
Mike
Can you provide me with any pointers to Assembla documentation?
Unfortunately, Assembla is a fairly new player in the cloud source control/project management game. Assembla it self is simply an open-source project. Assembla.com is a hosted version of the open-source software. There isn't much documentation on their features, and I typically have to resort to their forums (http://forum.assembla.com/)
What MIME types does TeamCity support for the POST requests?
Mike
Well for standard POST request content type must be: application/x-www-form-urlencoded, and the whole HTTP POST request looks like:
But as I see you do not have an option to set content type to "application/x-www-form-urlencoded". Maybe you would better to ask how to submit POST with parameters at Assembla forums?
I will give that a try and report anything I find back over here. Thanks for your help Pavel.
Mike
I got a response from an Assembla customer support representative. Their suggestion was to try and use text/plain with properly formatted content for the application/x-www-form-urlencoded MIME type. They also said they would consider this MIME type for future functionality. I requested that they simply support HTTP GET requests as well, since that would be easiest.
I tried formatting a text/plain message with simply this:
add2Queue=bt2
but TeamCity didn't seem to respond. I imagine its because TeamCity is not recognizing the text/plain content type. Is there any other content type it might recognize?