Can you give more context here? What is the URL you are trying to do this with? Feel free to remove personally identifiable info from it but leave the commands it is using please.
You did not mention it being a proxy error but everything I'm seeing points to 407 being an error you get when you use a proxy of some sort and do not set everything up fully. Try the link below.
https://blogs.msdn.microsoft.com/jpsanders/2009/03/24/httpwebrequest-webexcepton-the-remote-server-returned-an-error-407-proxy-authentication-required/