Skip to main content
Carmem_BR
Participant
July 13, 2010
Question

Tag <cfhttp> error 403

  • July 13, 2010
  • 1 reply
  • 840 views

tag  cfhttp cf9 brings in the error 403.
In CF8 works  correctly.
My code is:
<cfhttp  url="http://cep.republicavirtual.com.br/web_cep.php?cep=91010000&formato=xml"  charset="iso-8859-1" method="get") />

<cfif  Left(cfhttp.StatusCode,3) is "200">
    
<cfset xml =  xmlParse(cfhttp.fileContent)>
</ Cfif>

<cfdump var =  #httplStatusCode#>

Bring me the error 403.

Have to change  something on the server to use the tag with cfhttp cf9?

Thanks

    This topic has been closed for replies.

    1 reply

    Inspiring
    July 13, 2010

    Works for me just fine on CF9.  Note that there are some typos in your code:

    <cfhttp  url="http://cep.republicavirtual.com.br/web_cep.php?cep=91010000&formato=xml"  charset="iso-8859-1" method="get" />

    <cfif  Left(cfhttp.StatusCode,3) is "200">

         <cfset xml =  xmlParse(cfhttp.fileContent)> </ Cfif>

    <cfdump var =  "#cfhttp.StatusCode#">

    Gives me:

    200 OK


    Debugging Information

    Execution TimeFree MemoryTotal MemoryMax MemoryFree Allocated (%)Allocated (%)Templates / Queries / CFCs / Exceptions / Other TypesRunningReq / QueuedReq / TimedOutReq
    515213426115650%37%2 / 0 / 0 / 0 / 11 / 0 / 0
    reedtest127.0.0.107-13-2010 11:48:08Debug Time: 16ms
    http://localhost/reed/testabc246.cfm

    T E M P L A T E S
    Template[Line] (Parent)Execution TimeTimestampType
    C:\Inetpub\wwwroot\Reed\Testabc246.cfm[-1]48407/13/2010 11:48 AMtemplate
    C:\Inetpub\wwwroot\Reed\Application.cfm[-1]007/13/2010 11:48 AMtemplate

    O T H E R    T Y P E S
    TypeTemplateLineURLExecution TimeTimestampOther
    HttpC:\Inetpub\wwwroot\Reed\Testabc246.cfm13http://cep.republicavirtual.com.br:80/web_cep.php?cep=91010000&formato=xml46907/13/2010 11:48 AM

    Carmem_BR
    Carmem_BRAuthor
    Participant
    July 13, 2010

    The  code is the same as yours, but the error persists.
    The one is the wrong line of <cfdump>
    Just wrote wrong, the code is correct.

    We went yesterday to the cf9 ai crashed.
    NO CF8 works perfectly.