RESTful knowledge exchange
Post Reply
jerny_huang
Novice
Posts: 8
Liked: never
Joined: Aug 06, 2014 8:11 am
Full Name: Jerny Huang
Contact:

How to call sessionMgr api

Post by jerny_huang »

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();
        }
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: How to call sessionMgr api

Post by veremin »

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.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests