Disable Http Auto Redirect Url

Hello All,

Is there any config/setting to restrict Auto Follow Redirect in wM while making pub.client:http call?

Scenario:

While making Rest service call, Back end system passing Location param in header to redirect url which needs to be disabled in wM.

Currenly I’m Using wM IS 10.1 to implement this.

When i tried hitting back end system from postman, there is a setting to restrict Auto Follow Redirect. By using that setting, i could restrict the redirection and in turn see “Location” Param returned in the response header. [ Refer Attached Postman-Restrict-Autoredirect-Setting.jpg & Attached expectedResult.jpg ]

If i enable it, Redirection happens and could see the html page in the Response body [ Refer Attached Postman-Enable-Auto-Allow.jpg]

Same way,
Disable Auto Redirect needs to be implemented in wM pub.client:http call. By default, it is redirecting and giving html content in the response.

Any possibility to restrict it and get the Location Param in the Http Response Header [ Refer Attached expectedResult.jpg ]


A bit late for a reply but in case it may be helpful…

I am not aware of a way to prevent pub.client:http from following redirects. If you’re trying to capture what it redirects to, the output parm “encodedURL” holds that.

Hi Mahalakshmi Aravamudhan,

I am also having similar kind of requirement.Can you please update how you have implemented it

You can try setting watt.net.maxRedirects=0. (Restart of IS is not required) to disable redirection.

Specifies the maximum number of HTTP redirects to allow before throwing an I/O
exception.

1 Like