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?

9 comments
Comment actions Permalink

Have you tried to use POST? Actually POST requests for triggering build should work too.

0
Comment actions Permalink

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

0
Comment actions Permalink

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"

0
Comment actions Permalink

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

0
Comment actions Permalink

Can you provide me with any pointers to Assembla documentation?

0
Comment actions Permalink

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

0
Comment actions Permalink

Well for standard POST request content type must be: application/x-www-form-urlencoded, and the whole HTTP POST request looks like:

POST /httpAuth/action.html HTTP/1.1
Host: <server host>
Authorization: Basic <base 64 encoded username:password>
Content-Length: <num of bytes>
Content-Type: application/x-www-form-urlencoded

add2Queue=bt2


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?

0
Comment actions Permalink

I will give that a try and report anything I find back over here.  Thanks for your help Pavel.

Mike

0
Comment actions Permalink

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?

0

Please sign in to leave a comment.