Skip navigation
NASA-CFSME
Currently Being Moderated

ColdFusion 10 struct errors when a key has a dash

Apr 27, 2012 2:42 PM

I am trying to do a CFHTTP call with CF10 and one of the keys in the ResponseHeader struct has a dash "set-cookie".  ColdFusion 10 is throwing an error "Element CFHTTP.ResponseHeader.set" is undefined.  This code works fine in CF9.

 
Replies
  • Currently Being Moderated
    Apr 28, 2012 5:23 AM   in reply to NASA-CFSME

    It's difficult to comment sensibly without seeing some code.

     

    --

    Adam

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 29, 2012 11:17 PM   in reply to NASA-CFSME

    I think you are using 'httpResult.Responseheader.set-cookie' instead of 'httpResult.Responseheader['set-cookie'].'

     

    The mentioned error would be thrown on any version of ColdFusion when you have a hyphen in the key. To address this the key must be quoted inside square brackets i.e. structVariable['key'].

     

    Can you share the code that works on CF9?

     

    Sagar Ganatra.

    Adobe ColdFusion Team.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points