简体   繁体   中英

Coldfusion 302 redirect on http() request

I am trying to log in to a website using my application in coldfusion. It was working perfect until the website I get data from, changed their url after login to redirect to some other url. I have redirect = false set in the http() request. My application on http request gives me everything but location from the http request "Responseheader" When I try to manually log in to the website it has a location set to redirect URL in the POST response header . I don't understand why http request fails to get the location response header. I use coldfusion 11 update 3 and website I an trying to get data from is on Microsoft IIS 7.5

I think your issue is that ColdFusion's cfhttp call will follow redirects by default. Try adding the redirect=false argument to you cfhttp call. You should then be able to see the Location key in the Responseheader .

In cfscript this would be:

httpService = new http(); 
httpService.setRedirect(false);
...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM