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

Set HTTP StatusCode

New Here ,
Jul 24, 2006 Jul 24, 2006

Copy link to clipboard

Copied

Hi,

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)
{
cfabort
statuscode = cfhttp.statuscode
}

Greetings
TOPICS
Advanced techniques

Views

216

Translate

Translate

Report

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
Enthusiast ,
Jul 25, 2006 Jul 25, 2006

Copy link to clipboard

Copied

LATEST
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)

Votes

Translate

Translate

Report

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
Documentation