asp.net - webclient request via authentication -


i'm calling clients endpoint "get" json array. so

 var json = new webclient().downloadstring(url); 

they using authentication , have username , password. possible submit username , password. maybe need add custom headers? can't find exact examples i'm after

enter image description here

401 - unauthorized: access denied due invalid credentials.

you may try specify credentials:

var json = new webclient { credentials = new networkcredential(username, passwd) }.downloadstring(url); 

Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

datatable - Matlab struct computations -