The issue got resolved. The URL was not whitelisted in the network firewall which caused the error. Thanks