Get a Quote Today!   |   + 1 (301) 424 3903




 
  Community
 
Need Help?
Visit our Training page
Request a Quote or Consultation
SIGN UP FOR THE TERATECH NEWSLETTER
 

ColdCuts

Cut: CFHTTP in CFMX
Cut#: 320 
Cut Date: 07/05/2004 
Cutter: Ajay 
Topic: Error Handling 
Overview: Check CFHTTP.errorDetail before using headers. Normally, CFHTTP.Header has the full text of the HTTP Headers, CFHTTP.Responseheader is a struct of the header lines, and CFHTTP.StatusCode has the code ("200 OK", etc).

However, if domain doesn't resolve, or anything similar, CFHTTP.errorDetail will have the error info, CFHTTP.Responseheader will be a blank structure, and currently CFHTTP.Header is an undefined struct element, not a blank string! (Accessing header causes a "null null" error in our error handler, or the CFMX error handler shows it as a null pointer exception.)