I'm trying to use the HttpClient object to get an image from an IP Camera. Using the object for one type of camera works, but a different camera has different parameters that bring back a Http 401 error.
I pass in the IP Address of the camera. This works...
lnv_HttpClient.SendRequest("GET", "http://" + is_ip_camera + "/cgi-bin/encoder?USER=username&PWD=password&SNAPSHOT")
This doesn't...
lnv_HttpClient.SendRequest("GET", "http://username:password@" + is_ip_camera + "/ISAPI/Streaming/channels/1/picture")
I'm assuming it has to do with passing the username and password at the beginning of the URL instead of at the end.
If I put this in a browser it comes back fine. "http://username:password@IPAdress/ISAPI/Streaming/channels/1/picture"
How can I get the above to work with the HttpClient Object? The code below is how I create and populate the HttpClient Object. Thanks.
HttpClient lnv_HttpClient
//Allocate space for the HTTP Client
lnv_HttpClient = Create HttpClient
//Not to read data automatically after sending request (default is true)
lnv_HttpClient.AutoReadData = false
Using PB 2022 Build 1878 on Windows 10
https://ipcamtalk.com/threads/get-still-image-through-url-from-hikvision-nvr-solved.6279/
This is from the Hikvision site...
https://www.hikvision.com/content/dam/hikvision/en/support/how-to/how-to-document/network-cameras/How-to-Get-IPC-MJPEG-Stream-via-HTTP-Commands.pdf