system.net.httpClient

Hi,

Does the function system.net.httpClient() support [headerValues] as system.net.httpGet() does?
The API I'm using demands that authentication is done via a dictionary in [headerValues] .

Thanks,
Rickard

Headers are mentioned as parameters in the JythonHttpClient section:
https://docs.inductiveautomation.com/display/DOC81/system.net.httpClient

3 Likes

Yes, you are correct!
I'm a bit of a novice, I post the syntax if anybody else faces the same issue;

#API authorization`
dictionary = {
"Authorization": "Bearer " + token,
}
client = system.net.httpClient()
response = client.get(url=urlEndPoint,headers=dictionary)