1 Reply Latest reply on Jul 25, 2006 6:15 AM by Fernis

    Set HTTP StatusCode


      I'm using cfhttp to get some xml data from foreign server.
      Is it possible to set the http statuscode(of my cfm document) to the statuscode the cfhttp tag returns?

      Something like
      if(statuscode NEQ 200)
      statuscode = cfhttp.statuscode

        • 1. Re: Set HTTP StatusCode
          Fernis Level 3
          Place the http call before any possible output the page might generate, and use CFHEADER as early as possible - after the CFHTTP. I haven't played with the headers with CF, but it should be simple.

          Try <cfheader statuscode="#cfhttp.statuscode#" statustext="Not Found" /> ? (Replace the statustext if necessary)