Hello, i want to make a post request to the pimatic api.
I’m always getting exceptions that I’m unauthorized or security problems occured.
Where do i have to send my username and my password to?
for example I want to get the state of my variable globus:
Dim clientOb As New HttpClient
Dim pairs As New Dictionary(Of String, String)
pairs.Add("user", "myusername:mypassword")
Dim formContent As New HttpFormUrlEncodedContent(pairs)
Dim conURI As New Uri("http://192.168.2.100/api/variables/globus.state")
Dim response As HttpResponseMessage = Await clientOb.PostAsync(conURI, formContent)
Also username and password in the url doesnt work:
Dim conURI As New Uri("http://myusername:mypassword@192.168.2.100/api/variables/globus.state")
Anyone can help or provide some working code snippet? (C# or VB.Net)
Thanks in advance
AJ