Skip to main content
July 9, 2009
Question

cfhttp error on CF7 but not CF8 - need help

  • July 9, 2009
  • 1 reply
  • 1300 views

I have been battling this for a few days now, and I am starting to go a bit insane.  So, I am hoping someone can offer some assistance.

I am trying to make a call to the Live Contacts API.  On CF8, I can get this to work but on CF7 it throws an error:

<cfhttp url="#theURL#" method="get" result="httpResult">
     <cfhttpparam type="header" name="Authorization" value="DelegatedToken dt=""#dt#""" />
     <cfhttpparam type="header" name="Accept-Encoding" value="*" />

</cfhttp>

The Error:

Charset[empty string]
ErrorDetailI/O Exception: peer not authenticated
FilecontentConnection Failure
Header[undefined struct element]
MimetypeUnable to determine MIME type of file.
Responseheader
struct [empty]
StatuscodeConnection Failure.  Status code unavailable.
TextYES

theURL and dt are dynamically created with the info returned from the consent token.  This process fine and they are what they should be.  But there is a difference between versions that is throwing it off.  My theory is that it is a charset issue.  I ran into similar with Gmail Contacts API on CF7 v CF8.  I was able to get that resolved by using: charset="utf-8".  However, that doesn't work for Live.  <cfhttp url="#theURL#" method="get" result="httpResult" charset="utf-8">.

I have tried about every combination I can think of but still get a connection error.  On CF8 servers (tested on two different ones) it worked perfect.

In googling and looking at forums, I notice this in reference to an SSL issue.  I don't think that is the case here, as one of my servers doesn't have an SSL in use that would affect things.  But, it is in a hosting environment, so maybe.

I think I am missing something small or some combination of headers or something.  Any help would be greatly appreciated...and maybe ever rewarded with a Starbucks GC!  If you have any questions or need any more info let me know.

Thanks.

    This topic has been closed for replies.

    1 reply

    Inspiring
    July 9, 2009

    also sent to you on twitter:

    you have:

    <cfhttpparam type="header" name="Authorization" value="DelegatedToken dt=""#dt#""" />

    try:

    <cfhttpparam type="header" name="Authorization" value='DelegatedToken dt="#dt#"' />

    note the use of single and double quotes.

    not sure if that would cause it but worth a shot.

    Does the Live API require that the dt be surrounded by double quotes?

    July 9, 2009

    It claims it that is needs to be this way, but who knows.  I will try it on both versions and see what happens.  It can't hurt, thanks Sean.  I'll let you know either way.

    July 9, 2009

    That was a no-go Sean.  But worth the effort, as it wasn't a combo I have tried.  I'll see what else I can find and hopefully someone can come up with something.