Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Problems with CFHTTP

New Here ,
Mar 07, 2007 Mar 07, 2007
I keep getting "Connection Failure. Status code unavailable". This happen with GET and POST, I have tried adding
<cfhttpparam type="Header" name="TE" value="deflate;q=0"> but this does not help; have also tried adding charset="utf-8", this does not work either. Any suggestions?
2.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 07, 2007 Mar 07, 2007
Can you post the entire statement?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 07, 2007 Mar 07, 2007
This is a cfdump of the cfhttp variable:
Charset [empty string]
ErrorDetail Connect Exception: Connection timed out: connect
Filecontent Connection Failure
Header [undefined struct element]
Mimetype Unable to determine MIME type of file.
Responseheader
struct [empty]
Statuscode Connection Failure. Status code unavailable.
Text YES

and this is what I get if I set throwonerror = "yes":
Message Connection Failure: Status code unavailable
Detail
Unfortunately, the system did not understand your request. Please try again.
If you continue to receive this message, please contact your manager or support representative.
Extended Info
Tag Context C:\WebSites\speedshift\1x0x0\views\sms\candidatesmsresult.cfm (6)

(3) <cfset strBetaURL = "http:⁄⁄translate.google.com⁄translate_t⁄">
(4) <CFHTTP URL = "#strBetaURL#" method="post" charset="utf-8" resolveurl = 1 throwonerror="yes">
(5) <cfhttpparam type="formfield" name="text" value="test">
(6) <cfhttpparam type="Header" name="TE" value="deflate;q=0">
(7) <⁄CFHTTP>
(8) <cfdump var="#cfhttp#">
(9) <⁄cfoutput>

C:\WebSites\MachIII\framework\ViewContext.cfc (29)
C:\WebSites\MachIII\framework\EventContext.cfc (170)
C:\WebSites\MachIII\framework\commands\ViewPageCommand.cfc (31)
C:\WebSites\MachIII\framework\EventHandler.cfc (28)
C:\WebSites\MachIII\framework\EventContext.cfc (274)
C:\WebSites\MachIII\framework\EventContext.cfc (241)
C:\WebSites\MachIII\framework\EventContext.cfc (195)
C:\WebSites\MachIII\framework\RequestHandler.cfc (55)
C:\WebSites\MachIII\framework\RequestHandler.cfc (23)
C:\WebSites\MachIII\mach-ii.cfm (55)
C:\WebSites\speedshift\1x0x0\webroot\index.cfm (61)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 08, 2007 Mar 08, 2007
<cfset strBetaURL = "http:⁄⁄translate.google.com⁄translate_t⁄">

try

<cfset strBetaURL = "http:⁄⁄translate.google.com⁄translate_t">

translate_t isnt a folder so doesnt need a tailing /
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 08, 2007 Mar 08, 2007
I strongly recomment this tag as a replacement to cfhttp, it will solve a lot of your issues, especially in respect to timeouts, it has certainly saved me from punching my screen a few times!

http://www.cftagstore.com/tags/cfxhttp5.cfm

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Mar 08, 2007 Mar 08, 2007
I saw you included the TE header, but have you tried including the Accept-Encoding header as well?

<cfhttpparam type="Header" name="Accept-Encoding" value="deflate;q=0">
<cfhttpparam type="Header" name="TE" value="deflate;q=0">
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 08, 2007 Mar 08, 2007
LATEST
Unless there is a typo in your posted code, the first two forwad slashes after "http:" and the first in the path after ".com" are not the characters to be used in URL. They look like correct characters, but they are not. This is, perhaps, side effect of your editor.

If this is how you have URL in the actual code, your problem is that the URL string is invalid. No wonder, you have connection error. Re-type your URL string correctly.

By the way, this (correct) request returns 404.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources