Command line CURL command converted to CFML using cfhttp


I would like to convert this CURL command line to CFML using CFHTTP.    Is it possble?

Right now I output the code to a file.

Thank You!

## Authenticate
## Requires $GDATA_PASSWORD to be set as an environment variable.
G_AUTH_TOKEN=`curl 2>/dev/null \
    -d Email=#email# \
    -d Passwd=#password#  \
    -d accountType=GOOGLE \
    -d source=curlExample \
    -d service=blogger \
  | grep '^Auth=' | cut -c 6-`

## Post on my blog.
curl -v --request POST -H "Content-Type: application/atom+xml" \
    -H "Authorization: GoogleLogin auth=$G_AUTH_TOKEN" \
    "" --data "@blogpost.xml"

Open in new window

Who is Participating?
ThutM0seConnect With a Mentor Commented:
Sure. You would basically just open a CFHTTP tag with the POST method and specify your header values etc with cfhttpparam.

For example:

<cfhttp method="post" url="">

<cfhttpparam type="header" name="Content-type" value="application/atom+xml">

and so on. You'll have to specify the right types in your cfhttpparam tags for each piece of data your going to be posting. Check adobe live docs for the full syntax and parameters.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.