0

I have an HTTP object I am using in my application like so...

httpService = new http();
httpService.setURL("http://#application.thishost#/cfc/comp.cfc?method=methodName&oData=#url.oData#");
httpService.setPort(80);
httpService.setMethod("get");
httpService.setResolveURL("no");
httpService.setThrowOnError("yes");
local.response = httpService.send().getPrefix().filecontent;

For some reason this is throwing a 404 error and I can't figure out why. I have trapped the error and spit out httpService.getURL() and then pasted the URL into my browser and the page loads and executes without a problem. Any help appreciated.

Carl
  • 1,246
  • 3
  • 21
  • 39
  • So what happens if you replace `#application.thishost#` with the hard-coded value you think works? Is the URL reachable *from the box CF is running on*? You must have done more troubleshooting of this beyond what you say. What is it? – Adam Cameron Jun 05 '15 at 19:29
  • When I replaced application.thishost with the hard-coded value I got the 404 as well. I had not, however, tried bringing up the URL from the server itself. It didn't occur to me that it would serve to other clients but not its own. Oddly, enough, though, that appears to be the case. It comes up with the same 404 when I try to launch it from the server itself. – Carl Jun 05 '15 at 19:48
  • 1
    It's not that surprising really. App servers are very often configured to deal with inbound traffic but not outbound. Talk to your network admins. – Adam Cameron Jun 05 '15 at 19:55

0 Answers0