Help: Need to CFHTTP this cURL

I have never had the opportunity to use cURL before. But, now my manager wants to integrate a form submission to our third party vendor, Pivotal Tracker.

The cURL I'm referring to is here: https://www.pivotaltracker.com/help/api?version=v3#add_story


curl -H "X-TrackerToken: TOKEN" -X POST -H "Content-type: application/xml" \
-d "<story><story_type>feature</story_type><name>Fire torpedoes</name><requested_by>James Kirk</requested_by></story>" \
http://www.pivotaltracker.com/services/v3/projects/PROJECT_ID/stories

I have the TOKEN and the PROJECT_ID. I just don't know how to form the call with CFHTTP.

Any help is much appreciated.

Comments
Pedro Claudio's Gravatar This it work?

[cfhttp
url="http://www.pivotaltracker.com/services/v3/projects...;
method="POST"
result="objGet"]
[cfhttpparam type="HEADER" name="X-TrackerToken" value="TOKEN" /]
[cfhttpparam type="HEADER" name="Content-type" value="application/xml" /]
[cfhttpparam type="XML" value="<story><story_type>feature</story_type><name>Fire torpedoes</name><requested_by>James Kirk</requested_by></story>" /]
[/cfhttp]
# Posted By Pedro Claudio | 4/28/10 9:11 PM
Admin's Gravatar Yes, Pedro! That worked. Thank you very much
# Posted By Admin | 4/29/10 1:45 AM
Stefany's Gravatar hi, can you also convert it to javascript or jquery ajax ..
$.ajax({
url: url,
data: data,
...
});


thank you. any help would be much appreciated.
# Posted By Stefany | 5/13/10 5:15 AM
Admin's Gravatar I guess it's possible to just point the URL statement to a CFC on your server and have it return a status. If status is '200' alert something like, "successful upload" or if the status was anything other than '200', alert, 'Something happened to the upload".

$.ajax({
url: "http://www.someserver.com/cfc/mycfhttp.cfc?method=...;,
yadda yadda yadda
});
# Posted By Admin | 5/14/10 12:13 AM

Calendar

NAVIGATION

Recent Entries

Recent Comments

RSS

Search

Subscribe

Tags