# Chrome can view Annke C800 IP camera image but HTTP Request gets 401 response

**URL:** <https://discourse.nodered.org/t/chrome-can-view-annke-c800-ip-camera-image-but-http-request-gets-401-response/57156>\
**Category:** General\
**Tags:** http-request\
**Created:** [24 January 2022 17:35 UTC](https://discourse.nodered.org/t/chrome-can-view-annke-c800-ip-camera-image-but-http-request-gets-401-response/57156 "2022-01-24T17:35:07Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![nygma2004](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nygma2004/32/1308_2.png) [@nygma2004](https://discourse.nodered.org/u/nygma2004)\
**Post date:** [24 January 2022 17:35 UTC](https://discourse.nodered.org/t/chrome-can-view-annke-c800-ip-camera-image-but-http-request-gets-401-response/57156/1 "2022-01-24T17:35:07Z")

</div>

Hi Guys,

This issue is with an Annke C800 IP camera. I am trying to access the still image using the HTTP URL. I tested this URL in Chrome, and also in Edge and it returns the still image: `http://admin:password@192.168.1.210:80/ISAPI/Streaming/channels/1/picture`

And when I do the same in NR, I get a 401 Unauthorized. (No I am not logged into the admin site in a different Chrome window.)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/1/61de2048a783ba185cabea5164bb5170bb0a3d99.png)

I tried pasting in the link as below:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/7/07b094f00329c5ae4c8735dcf3e44520d04f0ac1.png)

I also tried to tick "Use Authentication" and pass the userid and password that way, but no change.

Next I checked the Request Headers in Chrome and added all of them in a function node before the HTTP request:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/6/76151960a73de624af87d43a0ee2c347c77abdbc.png)

Still no change. How could I "debug" this further? What else can I try? I actually talked to Annke but they obviously say that since it works in a browser, the issue must be Node-Red.

Any ideas?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [24 January 2022 17:46 UTC](https://discourse.nodered.org/t/chrome-can-view-annke-c800-ip-camera-image-but-http-request-gets-401-response/57156/2 "2022-01-24T17:46:02Z")

</div>

Have a look in the network tab in developer tools on the browser. Do you see any other headers or cookies in the request when you refresh the page?

I assume you have logged in on the browser some point and your credentials are cached.

If that doesn't work you might want to try the onvif nodes (assuming your camera support onvif).

---

<div class="post-metadata">

**Author:** ![nygma2004](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nygma2004/32/1308_2.png) [@nygma2004](https://discourse.nodered.org/u/nygma2004)\
**Post date:** [24 January 2022 19:32 UTC](https://discourse.nodered.org/t/chrome-can-view-annke-c800-ip-camera-image-but-http-request-gets-401-response/57156/3 "2022-01-24T19:32:34Z")

</div>

No Cookies as far as I can see:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/4/64a1f7ca6f790e583ffcb82a5bf873bdc64522ba.png)

And this is how the header looks like:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/6/56fc0de5b0d3835612c416ccdde5676271a14de2.png)

I thought it might catch the login details, but it works from Edge as well that I never used to log into the admin site.  
Onvif would be a good option, but for this particular camera the get image function crashes the entire Node-Red. I have a thread open on that, but I don't expect quick resolution of that issue.

---

<div class="post-metadata">

**Author:** ![kinser06](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kinser06/32/54589_2.png) [@kinser06](https://discourse.nodered.org/u/kinser06)\
**Post date:** [25 January 2022 00:23 UTC](https://discourse.nodered.org/t/chrome-can-view-annke-c800-ip-camera-image-but-http-request-gets-401-response/57156/4 "2022-01-25T00:23:07Z")

</div>

You might need to send that request header data through a function node into your http request node. I’ll try to post you an example in a bit.

---

<div class="post-metadata">

**Author:** ![wb666greene](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/wb666greene/32/6534_2.png) [@wb666greene](https://discourse.nodered.org/u/wb666greene)\
**Post date:** [25 January 2022 00:36 UTC](https://discourse.nodered.org/t/chrome-can-view-annke-c800-ip-camera-image-but-http-request-gets-401-response/57156/5 "2022-01-25T00:36:48Z")

</div>

I'm not sure Onvif would help, as that URL looks a lot like the URL for an Onvif "snapshot"

Two of my "onvif" cameras snapshot URLs:  
[http://admin:admin@192.168.2.61:80/tmpfs/auto.jpg](http://admin:admin@192.168.2.61:80/tmpfs/auto.jpg)  
[http://192.168.2.53/webcapture.jpgcommand=snap&channel=1&user=admin&password=tlJwpbo6](http://192.168.2.53/webcapture.jpgcommand=snap&channel=1&user=admin&password=tlJwpbo6)

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [25 January 2022 00:38 UTC](https://discourse.nodered.org/t/chrome-can-view-annke-c800-ip-camera-image-but-http-request-gets-401-response/57156/6 "2022-01-25T00:38:21Z")

</div>

Also read this thread from the Annke forum .. worth to also try the url mentioned there

`http://admin:abcd1234@192.168.1.210/ISAPI/Streaming/channels/102/httpPreview`

> **[I just bought C800 POE and need HTTP MJPEG URL](https://help.annke.com/hc/en-us/community/posts/900003112403-I-just-bought-C800-POE-and-need-HTTP-MJPEG-URL)**
>
> I just bought https://www.amazon.com/gp/product/B07V8H5QQ1 and have figured out main rtsp H265 stream at rtsp://user:password@ip:554/H264/ch1/main/av\_stream and MJPEG sub stream at rtsp://user:pass...

---

<div class="post-metadata">

**Author:** ![nygma2004](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nygma2004/32/1308_2.png) [@nygma2004](https://discourse.nodered.org/u/nygma2004)\
**Post date:** [25 January 2022 18:18 UTC](https://discourse.nodered.org/t/chrome-can-view-annke-c800-ip-camera-image-but-http-request-gets-401-response/57156/8 "2022-01-25T18:18:31Z")

</div>

> [@kinser06](#):
>
> You might need to send that request header data through a function node into your http request node. I’ll try to post you an example in a bit.

Yes I did that. If you check my first screenshots, I did have a function node with header data populated, but that did not help either.

---

<div class="post-metadata">

**Author:** ![nygma2004](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nygma2004/32/1308_2.png) [@nygma2004](https://discourse.nodered.org/u/nygma2004)\
**Post date:** [25 January 2022 18:21 UTC](https://discourse.nodered.org/t/chrome-can-view-annke-c800-ip-camera-image-but-http-request-gets-401-response/57156/9 "2022-01-25T18:21:25Z")

</div>

> [@UnborN](#):
>
> Also read this thread from the Annke forum .. worth to also try the url mentioned there

Yes, I have seen this topic. The link with the httpPreview at the end if a streaming video link for the sub stream. And that is behaving the same, works from Chrome, but gives 401 Unauthorized from Node-Red.

---

<div class="post-metadata">

**Author:** ![nygma2004](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nygma2004/32/1308_2.png) [@nygma2004](https://discourse.nodered.org/u/nygma2004)\
**Post date:** [25 January 2022 18:22 UTC](https://discourse.nodered.org/t/chrome-can-view-annke-c800-ip-camera-image-but-http-request-gets-401-response/57156/10 "2022-01-25T18:22:21Z")

</div>

> [@wb666greene](#):
>
> I'm not sure Onvif would help, as that URL looks a lot like the URL for an Onvif "snapshot"

The link works fine in Chrome and gives me the still image. And for this camera this is the documented official link.

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [25 January 2022 19:17 UTC](https://discourse.nodered.org/t/chrome-can-view-annke-c800-ip-camera-image-but-http-request-gets-401-response/57156/11 "2022-01-25T19:17:04Z")

</div>

> [@nygma2004](#):
>
> I also tried to tick "Use Authentication" and pass the userid and password that way, but no change.

Silly question but when you tried the Use Authentication option i imagine you used Basic Authentication and you removed the `admin:pass@` from the url ?

---

<div class="post-metadata">

**Author:** ![nygma2004](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nygma2004/32/1308_2.png) [@nygma2004](https://discourse.nodered.org/u/nygma2004)\
**Post date:** [25 January 2022 19:35 UTC](https://discourse.nodered.org/t/chrome-can-view-annke-c800-ip-camera-image-but-http-request-gets-401-response/57156/12 "2022-01-25T19:35:25Z")

</div>

> [@UnborN](#):
>
> Silly question but when you tried the Use Authentication option i imagine you used Basic Authentication and you removed the `admin:pass@` from the url ?

Yes, I tried. Both with the u/p in the URL and also removed from the URL and added to the "Use authentication" section with "basic authentication".

If I put the plain URL into Chrome (without the user and password), I get the Chrome logon window, but after entering the u/p I get the image. So the user authentication works. There must be some stupid cookie or header issue, but I can't see what it can be.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [25 January 2022 23:00 UTC](https://discourse.nodered.org/t/chrome-can-view-annke-c800-ip-camera-image-but-http-request-gets-401-response/57156/13 "2022-01-25T23:00:45Z")

</div>

If you copy the curl request (via network tab) and paste it in a terminal, does it work?

---

<div class="post-metadata">

**Author:** ![nygma2004](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nygma2004/32/1308_2.png) [@nygma2004](https://discourse.nodered.org/u/nygma2004)\
**Post date:** [26 January 2022 06:44 UTC](https://discourse.nodered.org/t/chrome-can-view-annke-c800-ip-camera-image-but-http-request-gets-401-response/57156/14 "2022-01-26T06:44:35Z")

</div>

No, it is the same, I get 401 here as well:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/2/b2cf2940b2a34b7e96c4de407e076362f3695082.png)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [26 January 2022 06:49 UTC](https://discourse.nodered.org/t/chrome-can-view-annke-c800-ip-camera-image-but-http-request-gets-401-response/57156/15 "2022-01-26T06:49:36Z")

</div>

Did you copy the curl from developer tools network tab or build it yourself?

---

<div class="post-metadata">

**Author:** ![nygma2004](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nygma2004/32/1308_2.png) [@nygma2004](https://discourse.nodered.org/u/nygma2004)\
**Post date:** [26 January 2022 07:14 UTC](https://discourse.nodered.org/t/chrome-can-view-annke-c800-ip-camera-image-but-http-request-gets-401-response/57156/16 "2022-01-26T07:14:01Z")

</div>

I have taken the Request URL from developer tools and typed `curl` and pasted that URL in. I hope this is what you meant:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/5/9528e9f3750e4ed2900076cd78c1ef39980ae8ed.jpeg)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [26 January 2022 07:17 UTC](https://discourse.nodered.org/t/chrome-can-view-annke-c800-ip-camera-image-but-http-request-gets-401-response/57156/17 "2022-01-26T07:17:41Z")

</div>

No. Right click the entry in the network requests list (far left where it says "picture") -\> copy -\> as curl

It will include all the headers and settings etc

Try that

If it works, copy & paste the exact curl here (xxx the password)

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [26 January 2022 07:20 UTC](https://discourse.nodered.org/t/chrome-can-view-annke-c800-ip-camera-image-but-http-request-gets-401-response/57156/18 "2022-01-26T07:20:12Z")

</div>

In addtion I would recommend, logout the cam, clear the cache/details, login and without doing anything else, copy the request from the main index/html page:

 ![Screenshot 2022-01-26 at 08.19.42](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/3/53607cf45cefeb10f306e84a80e96be39e90229d.jpeg)

---

<div class="post-metadata">

**Author:** ![nygma2004](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nygma2004/32/1308_2.png) [@nygma2004](https://discourse.nodered.org/u/nygma2004)\
**Post date:** [26 January 2022 08:06 UTC](https://discourse.nodered.org/t/chrome-can-view-annke-c800-ip-camera-image-but-http-request-gets-401-response/57156/19 "2022-01-26T08:06:12Z")

</div>

Ah OK, got it now. Cache cleared, I copy the cURL from the developer mode and I got this in the terminal:

```auto
nygma@NodeRedServer:~$ curl "http://admin:XXXXX^@192.168.1.210/ISAPI/Streaming/channels/1/picture" ^
  -H "Connection: keep-alive" ^
  -H "Upgrade-Insecure-Requests: 1" ^
  -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36" ^
  -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" ^
  -H "Accept-Language: en-GB,en;q=0.9,en-US;q=0.8,hu;q=0.7" ^
  --compressed ^
  --insecure
<!DOCTYPE html>
<html><head><title>Document Error: Unauthorized</title></head>
<body><h2>Access Error: 401 -- Unauthorized</h2>
<p>Authentication Error</p>
</body>
</html>
curl: (6) Could not resolve host: ^
-bash: -H: command not found
-bash: -H: command not found
-bash: -H: command not found
-bash: -H: command not found
-bash: -H: command not found
-bash: --compressed: command not found
-bash: --insecure: command not found

```

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [26 January 2022 08:09 UTC](https://discourse.nodered.org/t/chrome-can-view-annke-c800-ip-camera-image-but-http-request-gets-401-response/57156/20 "2022-01-26T08:09:43Z")

</div>

Looks like you did not copy as bash (should be `\` line continuations not `^`

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/2/52e3a849e65370a19001b7dfbe7ecdb2c3b41203.png)

Are you using chrome?

---

<div class="post-metadata">

**Author:** ![nygma2004](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nygma2004/32/1308_2.png) [@nygma2004](https://discourse.nodered.org/u/nygma2004)\
**Post date:** [26 January 2022 08:11 UTC](https://discourse.nodered.org/t/chrome-can-view-annke-c800-ip-camera-image-but-http-request-gets-401-response/57156/21 "2022-01-26T08:11:37Z")

</div>

Yes, I use Chrome. The result is very similar:

```auto
nygma@NodeRedServer:~$ curl 'http://admin:XXXXXX@192.168.1.210/ISAPI/Streaming/channels/1/picture' \
  -H 'Connection: keep-alive' \
  -H 'Cache-Control: max-age=0' \
  -H 'Upgrade-Insecure-Requests: 1' \
  -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36' \
  -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9' \
  -H 'Accept-Language: en-GB,en;q=0.9,en-US;q=0.8,hu;q=0.7' \
  --compressed \
  --insecure
<!DOCTYPE html>
<html><head><title>Document Error: Unauthorized</title></head>
<body><h2>Access Error: 401 -- Unauthorized</h2>
<p>Authentication Error</p>
</body>
</html>
nygma@NodeRedServer:~$

```

[Next page](https://discourse.nodered.org/t/chrome-can-view-annke-c800-ip-camera-image-but-http-request-gets-401-response/57156.md?page=2)
