Skip to main content
Participant
December 3, 2009
Question

CFHTTP request with content-type "application/atom+xml"

  • December 3, 2009
  • 1 reply
  • 763 views

Is it possible to send a HTTP request (method="post")  with a body that has a set content-type (such as "application/atom+xml")?

using CFHTTP and CFHTTPPRAM, it seems the tag does not accept a content-type.

<cfhttpparam type="body" value="#myAtomXML#">

is there anyway to have CFHTTP , post the body with a given content-type?

IF NOT, could anyone point me to the right direction to accompolish this using Java?

    This topic has been closed for replies.

    1 reply

    Inspiring
    December 4, 2009

    Hi,

    Have you tried the "mimetype" attribute of the <cfhttpparam> tag?.

    http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_g-h_10.html

    seeker_1Author
    Participant
    December 4, 2009

    mimetype is not useful in this case.

    livedocs: "mimetype" of cfhttp tag : "Applies to File type; invalid for all other types. ..."

    I need to post my request with two headers (no problem here) and a body which needs to sen with content-type "application/atom+xml"

    seeker_1Author
    Participant
    December 4, 2009

    Problem solved.

    I simply added this to my request:

    <cfhttpparam type="header" name="Content-Type" value="application/atom+xml; charset=utf-8" />