1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Rockville, MD
    Rep Power

    Unhappy Please help student with CFHTTPRequest in CF5


    My question to anyone is did MM update this function in MX or left it alone? I am using the CF5 Developer Server for development and the function works but all of what I read mentions it as a new function in MX.


    I am attempting to use the function and can not get the content string back but I get a content_length of the data that I sent to the cfm file.

    My code is:

    <cfset x = GetHttpRequestData()>
    <cfset xdata ="">
    <cfloop collection = #x.headers# item = "http_item">
    <cfset xdata = "#xdata#<record item='#xmlformat(http_item)#' value='#xmlformat(StructFind(x.headers, http_item))#' />">
    <cfoutput><cfcontent type="text/xml"><?xml version='1.0'?><some>#xdata#<content value='#x.content#' /><method value='#x.method#' /></some></cfoutput>

    The response I get is always:

    <?xml version='1.0'?><some><record item="CACHE_CONTROL" value="no-cache" /><record item="CONTENT_LENGTH" value="71" /><record item="CONTENT_TYPE" value="application/x-www-form-urlencoded" /><record item="COOKIE" value="CFID=1; CFTOKEN=26067650" /><record item="HOST" value="" /><record item="USER_AGENT" value="Shockwave Flash" /><content value="" /><method value="GET" /></some>

    Before you suggest that I upgrade to MX for CF or Flash, I am a student and can't afford the 1500 to upgrade. But I am just wondering why I would be getting all of this info back with a content_length of 71 but no content. Can I not access the content?

    Student, Montgomery College Rockville MD
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2001
    Washington DC, USA
    Rep Power

    Raw content from the form submitted by the client, in string or binary format. For content to be considered string data, the FORM request header "CONTENT_TYPE" must start with "text/" or be special case "application/x-www-form-urlencoded". Other types are stored as a binary object.

    I'm not 100% sure on this one, but it makes reference to the content being retrieved via a form (presumably the POST method)but your method is actually GET. Can you try your script by invoking it via POST?

IMN logo majestic logo threadwatch logo seochat tools logo