How to call sessionMgr api

RESTful knowledge exchange

How to call sessionMgr api

Veeam Logoby jerny_huang » Wed Aug 06, 2014 9:34 am

I call sessionMgr api with C#, but failed. I need to help.

Code: Select all
public static void SetBasicAuthHeader(String userName, String userPassword)
        {
            var req = WebRequest.Create("http://10.17.68.170:9399/api/sessionMngr/");
            string authInfo = userName + ":" + userPassword;
            authInfo = Convert.ToBase64String(Encoding.ASCII.GetBytes(authInfo));
            req.Headers["Authorization"] = "Basic " + authInfo;
            req.GetResponse();
        }
jerny_huang
Novice
 
Posts: 8
Liked: never
Joined: Wed Aug 06, 2014 8:11 am
Full Name: Jerny Huang

Re: How to call sessionMgr api

Veeam Logoby v.Eremin » Wed Aug 06, 2014 10:29 am

And what errors you had? I'm not that familiar with C#, but shouldn't a web request be declared as a POST one? Something like webRequest.Method = "POST"? Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to RESTful API



Who is online

Users browsing this forum: No registered users and 4 guests