How to apply credentials in PTV C#.JSON clients
Posted: Tue Sep 20, 2022 2:45 pm
Cheerio,
as some of you might have noticed: we now also provide C# Client classes which are using JSON as message protocol for the exchange with PTV xServer2. Though we added a generic description into the Developers Guide I was missing the specific sample for the application of credentials. I already requested the chapter from DEV.
In the meantime check this piece of code to gather how to apply the credentials. The variable xtok is of course needed to be assigned first.
Best regards,
Bernd
as some of you might have noticed: we now also provide C# Client classes which are using JSON as message protocol for the exchange with PTV xServer2. Though we added a generic description into the Developers Guide I was missing the specific sample for the application of credentials. I already requested the chapter from DEV.
In the meantime check this piece of code to gather how to apply the credentials. The variable xtok is of course needed to be assigned first.
Code: Select all
IXServer xServerClient = new XServer(new Uri("https://xserver2-test.cloud.ptvgroup.com"), new HttpClientHandler {
Credentials = new System.Net.NetworkCredential {
UserName = "xtok",
Password = xtok
}
});;
Bernd