How to call JAVA API from ASP .Net Core

public static string GetAPIResponse()
{
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls | SecurityProtocolType.Ssl3;
string response = string.Empty;
string token = “VGhpcyB0b2tlbiBpcyBnZW5lcmF0ZWQgYnkgVmliZXJzb2w=
“;
string URL = “https://Vibersol.com/API/GetUserDetails/”
string AccessKey = “Basic ” + token;
var content = “grant_type=Admin&username=Vibersol&password=123”;
using (WebClient wc = new WebClient())
{
wc.Headers[“Content-Type”] = “application/x-www-form-urlencoded”;
wc.Headers[“Authorization”] = AccessKey;
wc.Headers[“X-User-Agent”] = “Test”;
response = wc.UploadString(URL, “POST”, content);

}
return response;
}

Vibersol Technology

VibersolTech is a leading platform that provides computer science resources and coding challenges for programmers and technology enthusiasts, along with interview and exam preparations for upcoming aspirants. With a strong emphasis on enhancing coding skills like Python, Java, React, Angular, .Net Core, MS SQL, MySQL, Software Reviews and many more. The platform offers a vast collection of tutorials, practice problems, interview tutorials, articles, and courses, covering various domains of computer science. Our exceptional mentors hailing from top colleges & organizations have the ability to guide you on a journey from the humble beginnings of coding to the pinnacle of expertise. Under their guidance watch your skills flourish as we lay the foundation and help you conquer the world of coding. Our brand is built on the pillars of expertise, accessibility, and community. We strive to empower individuals to enhance their programming skills, to bridge the gap between academia and industry, and provide a supportive community to the learners. Vibersol is committed to promoting technological advancement and providing opportunities for growth in the ever-evolving field of computer science.

View All Post

Leave a Reply

Your email address will not be published. Required fields are marked *