Chuyên Tin Chuyên Tin - 10 months ago 114
C# Question

How to bypass 403 forbidden exception when request use HTTPWEBREQUEST

How to bypass 403 forbidden exception, when request is:


// what do I write in here

Answer Source

You can't "bypass" it - if the web server is tell you you're not allowed to get the data, you can't get the data. If you don't need that response then that's fine - handle the exception and keep going in whatever way you need to.

Alternatively, work out why you're getting that response, and perform whatever authentication you need in order to make a successful request. Without knowing anything about what you're trying to fetch, it's hard to suggest anything more concrete.