In .net core, if you need to call 3rd party API, you may have to create an object of WebClient and do some steps to retrieve and send data to that API. today I am going to explain to you how you can create WebClient and how you can set up proxy settings in WebClient so you can call API throw proxy and retrieve any data. First of all, you need to create a dictionary of strings which can contain headers for 3rd party API, that code should be as following, you can add more parameters as per your need, for me, I just added one header. public Dictionary < string , string > GetHeaderForJson () { Dictionary < string , string > headers = new Dictionary < string , string >(); headers . Add ( "Content-Type" , "application/json" ); return headers ; } one you created a header dictionary its time to create WebClient...
Comments
Post a Comment