Hi i am trying to create application using rest api
Application objroot = new Application();
//Create Application Object//
objroot.restURI = “http://localhost:8087/v2/servers/defaultServer/vhosts/defaultVHost/applications/” + name;
objroot.name = name;
objroot.appType = appType;
objroot.clientStreamReadAccess = “*”;
objroot.clientStreamWriteAccess = “*”;
objroot.description = description;
StreamConfig objstreamingconfig = new StreamConfig();
objstreamingconfig.restURI = “http://localhost:8087/v2/servers/defaultServer/vhosts/defaultVHost/applications/”+name+"/streamconfiguration";
objstreamingconfig.streamType = appType;
//////////////////////////
objroot.streamConfig = objstreamingconfig;
//call Http client to post rest api…
HttpClient client = new HttpClient();
client.BaseAddress = new Uri(“http://localhost:8087/v2/servers/defaultServer/vhosts/defaultVHost/applications/”+name+" -d");
//to set credentials on
var byteArray = Encoding.ASCII.GetBytes(UserName + “:” + Password);
client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue(“Basic”, Convert.ToBase64String(byteArray));
////////////////
here i am getting response : Unauthorized
Please help me, what i am doing wrong ?