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

Java 8 + Maven Javadoc plugin: Error fetching URL -

android - How to delete or change the searchview icon inside the SearchView actionBar? -

c++ - Msgpack packing bools bug -