Network Credentials on HttpRequestMessage
Is it possible to add network credentials to a HttpRequestMessage. In C/AL we were able to use a variable of type System.Net.NetworkCredential.'System and then call
NetworkCredential := NetworkCredential.NetworkCredential(UserName,Password,Domain);
HttpWebRequest.Credentials := NetworkCredential;
Are there any examples of using this on HttpRequestMessage or HttpHeaders in AL?
The HttpWebRequest class has been obsolete for a long, long time in the .net framework. You can use the request headers of the HttpClient/HttpRequestMessage to take care of authentication.
@erikrijn We can add basic authorization to the HttpHeader but we're after an example using Network Credentials with a domain.
Any update/answer on this? @StanislawStempin
You should inspect how the http request looks like when using your original .NET code and then recreate the same request by directly inserting the relevant values into the http headers.
Is there any example on how to use network credentials with http headers ? I cannot find a solution to that on AL