0

I am making a cfhttp call to a URL.The URL is opening fine on my machine. The URL is also not an SSL encrypted URL.But I am getting cfhttp.statuscode as "403 Forbidden". Please Let me know is there any way to fix the issue. Codes : Error Detail {

<cfhttp redirect="no" url="#desturl#" method="GET" timeout="20" userAgent="#useragent_txt#"/>

}

Jeromy French
  • 11,812
  • 19
  • 76
  • 129
Deepak Kumar Padhy
  • 4,128
  • 6
  • 43
  • 79
  • I've encountered this sometimes if I don't send a recognised user-agent string with my request via CFHTTP. I presume it's some sort of measure to block bots... or people scraping the page ;-) – Adam Cameron Jul 19 '13 at 08:03
  • @AdamCameron I have sent the useragent ("Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/4.0 (.NET CLR 3.5.30729)") also , but still its showing the same error. – Deepak Kumar Padhy Jul 19 '13 at 09:15
  • Can you surf to the URL from a browser on the ColdFusion server? – Miguel-F Jul 19 '13 at 11:42
  • 403 Forbidden is not limited to pages/sites that are configured for SSL. For example, both Apache and IIS will return 403 Forbidden when directory browsing is turned off and there is no document that matches the default document configuration in the directory being accessed. Whenever I receive a 403 error, I always assume it is a permissions issues until proven it is not (can't recall a time where it wasn't). Is it safe to assume that you can hit the ULR in question directly from a browser window? – Scott Stroz Jul 19 '13 at 11:45
  • @ScottStroz: Yes i can browse that url from my browser . – Deepak Kumar Padhy Jul 19 '13 at 12:10
  • Is it a public URL? One we may be able to hit to help you out? Is there any kind of authentication in front of the URL (maybe Windows authentication)? – Scott Stroz Jul 19 '13 at 12:29
  • @ScottStroz Yes this is a public URL: http://www.sears.com/active-care-active-care-osprey-4410-power-handicap/p-SPM1655544201P?prdNo=3&blockNo=3&blockType=G3 Please check. – Deepak Kumar Padhy Jul 19 '13 at 12:49
  • Not that it helps but I created a quick test page and made a `cfhttp` call to that URL and also get Forbidden. Using ColdFusion 9.0.1 – Miguel-F Jul 19 '13 at 14:09
  • Finally any one please suggest me this is possible or not. – Deepak Kumar Padhy Jul 19 '13 at 14:40
  • Do you need to have the extra info in the query string? Using http://www.sears.com/active-care-active-care-osprey-4410-power-handicap/p-SPM1655544201P in cfhttp it worked as expected in CF 10. – Scott Stroz Jul 19 '13 at 14:44
  • Actually, even with the query string data it worked in CF 10. – Scott Stroz Jul 19 '13 at 14:45
  • It even worked for me in CF9, version 9,0,1,274733 – Scott Stroz Jul 19 '13 at 14:48
  • @ScottStroz So is this problem with CF9 only, I am not sure. – Deepak Kumar Padhy Jul 19 '13 at 14:49
  • @DeepakKumarPadhy it worked for me locally on CF 9.01. I am working on trying to test on CF 9.0.2 – Scott Stroz Jul 19 '13 at 15:07
  • @ScottStroz: Thanks , I will update my CF server and try . – Deepak Kumar Padhy Jul 19 '13 at 15:12
  • 1
    9.0.2 with latest hotfixes works as well - http://www.boyzoid.com/stuff/test.cfm – Scott Stroz Jul 19 '13 at 15:20
  • 1
    Here is the code I used ` ` – Scott Stroz Jul 19 '13 at 15:22
  • @ScottStroz: Thanks a lot, this worked for me also . previously I was sending the useragent , now after removing this it is working fine. – Deepak Kumar Padhy Jul 22 '13 at 05:39
  • I had this problem with a site that got proxied through CloudFlare DNS – Seybsen Dec 17 '21 at 09:38

0 Answers0