Having used both CLR WebRequest and HttpClient to connect to a web URL, I got interested in Headers.
using System.Net.Http.HttpClient
oClient.DefaultRequestHeaders.Add("User-Agent","Other")
oClient.DefaultRequestHeaders.Add("Accept","application/geo+json")
works, and for System.Net.WebRequest
request.UserAgent = "Other"
request.ContentType = "application/geo+json"
works as well
but oClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); [in C#] but cannot convert to WB CLR fails
which requires ObjectClrOption("useany", "System.Net.Http.Headers") as a namespace, but I cannot instantiate that in WB, error that assembly cannot be found or loaded.
Guess a little clarification on how a request for Content-Type and other headers might be handled with HttpClient?
"System.Net.Http.Headers" is a namespace and not an assembly and "HttpHeaders" is an abstract class. You could do something like the following:
ObjectClrOption("useany", "System.Net.Http")
objHeaders = ObjectClrNew('System.Net.Http.Headers.MediaTypeWithQualityHeaderValue')
But that is about it.
Thanks.