# HTTP Request Fails

**URL:** https://discourse.nodered.org/t/http-request-fails/44460
**Category:** General
**Created:** [20 April 2021 13:03 UTC](https://discourse.nodered.org/t/http-request-fails/44460 "2021-04-20T13:03:27Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Randy](https://avatars.discourse-cdn.com/v4/letter/r/2acd7d/32.png) [@Randy](https://discourse.nodered.org/u/Randy)
#### Post date: [20 April 2021 13:03 UTC](https://discourse.nodered.org/t/http-request-fails/44460/1 "2021-04-20T13:03:27Z")

</div>

I can use this url in a browser and it will make my PTZ camera change to the preset number  
[http://192.168.1.110/axis-cgi/com/ptz.cgi?gotoserverpresetno=1](http://192.168.1.110/axis-cgi/com/ptz.cgi?gotoserverpresetno=1)

However using a HTTP Request Node with POST, the camera does not move. In the debug window, this error is returned. I've tried adding [user:password@192.168.1.110](mailto:user:password@192.168.1.110) to the beginning of the url without success.

401 Unauthorized
# Unauthorized

This server could not verify that youare authorized to access the documentrequested. Either you supplied the wrongcredentials (e.g., bad password), or yourbrowser doesn't understand how to supplythe credentials required.

This is the first time I've tried the HTTP nodes so I'm not familiar with their operation.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [20 April 2021 13:18 UTC](https://discourse.nodered.org/t/http-request-fails/44460/2 "2021-04-20T13:18:05Z")

</div>

> [@Randy](#):
>
> I can use this url in a browser and it will make my PTZ camera change to the preset number

Do you mean you just enter that in the address bar and it moves the camera? If so then that is a GET not a POST.  
Do you have to logon to the camera before it works in the browser?

---

<div class="post-metadata">

### Author: ![Randy](https://avatars.discourse-cdn.com/v4/letter/r/2acd7d/32.png) [@Randy](https://discourse.nodered.org/u/Randy)
#### Post date: [20 April 2021 13:39 UTC](https://discourse.nodered.org/t/http-request-fails/44460/3 "2021-04-20T13:39:11Z")

</div>

I changed POST to GET without success.  
Tried a different browser to make sure nothing was stored in cache. And yes, the camera asked for a log in then the url made the camera move so my issue must be authentication.

Another internet posting indicates that [http://user:password@192.168.1.110](http://user:password@192.168.1.110) is the method for one step authentication but it must not be working?

---

<div class="post-metadata">

### Author: ![Randy](https://avatars.discourse-cdn.com/v4/letter/r/2acd7d/32.png) [@Randy](https://discourse.nodered.org/u/Randy)
#### Post date: [20 April 2021 13:52 UTC](https://discourse.nodered.org/t/http-request-fails/44460/4 "2021-04-20T13:52:00Z")

</div>

I found a setting in the Axis camera that allows anonymous PTZ control (no user name or password required) But anonymous viewer login must also be enabled.

Now my HTTP request works but I'm not happy that the camera is open to anyone even though it is behind my firewall.

Need to find the correct url for a Axis P5415 that works with [http://user:password@192.168.1.110](http://user:password@192.168.1.110) so I can secure the camera again.

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [20 April 2021 14:15 UTC](https://discourse.nodered.org/t/http-request-fails/44460/5 "2021-04-20T14:15:58Z")

</div>

The request would be `http://user:password@192.168.1.110/axis-cgi/com/ptz.cgi?gotoserverpresetno=1`  
where user is your usernname and password is your password. If you never set one then try the default user and password for your camera(google default user password camera model) common defaults would be  
user : admin  
password : 12345678  
11111111  
00000000

---

<div class="post-metadata">

### Author: ![Randy](https://avatars.discourse-cdn.com/v4/letter/r/2acd7d/32.png) [@Randy](https://discourse.nodered.org/u/Randy)
#### Post date: [20 April 2021 14:22 UTC](https://discourse.nodered.org/t/http-request-fails/44460/6 "2021-04-20T14:22:16Z")

</div>

Yes I have set a password in the camera. But [http://user:password@192.168.1.110/axis-cgi/com/ptz.cgi?gotoserverpresetno=2](http://user:password@192.168.1.110/axis-cgi/com/ptz.cgi?gotoserverpresetno=2) still returns an authentication error in the debug window and the camera doesn't move.

Turning off authentication in the camera and [http://192.168.1.110/axis-cgi/com/ptz.cgi?gotoserverpresetno=2](http://192.168.1.110/axis-cgi/com/ptz.cgi?gotoserverpresetno=2) works just fine.

I just need to figure out what the camera is wanting for a single line url with user name and password embedded in the url?

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [20 April 2021 14:24 UTC](https://discourse.nodered.org/t/http-request-fails/44460/7 "2021-04-20T14:24:22Z")

</div>

You did not confirm whether it is a GET or a POST you are using. If it is a POST then it is a little more tricky.

You said you were worried about it being open to everyone, do you mean you don't want others connected to the local network to access it or is it those on the internet you want to stop? If the internet then have you opened any ports in your router?

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [20 April 2021 14:24 UTC](https://discourse.nodered.org/t/http-request-fails/44460/8 "2021-04-20T14:24:36Z")

</div>

~~No one can help as you have not named the camera model.~~  
[edit] strike that i just saw model  
According to the manual you have to set the default administrator user root. Is the user password the administrator one?

---

<div class="post-metadata">

### Author: ![Randy](https://avatars.discourse-cdn.com/v4/letter/r/2acd7d/32.png) [@Randy](https://discourse.nodered.org/u/Randy)
#### Post date: [20 April 2021 14:45 UTC](https://discourse.nodered.org/t/http-request-fails/44460/9 "2021-04-20T14:45:43Z")

</div>

I am using GET. With PTZ control authentication in the camera turned off, it works fine.

This camera is not ported to the internet and I'm not too worried about someone on the lan side messing with it. But having all authentication to the camera turned off just makes me concerned.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [20 April 2021 15:03 UTC](https://discourse.nodered.org/t/http-request-fails/44460/10 "2021-04-20T15:03:25Z")

</div>

> [@Randy](#):
>
> having all authentication to the camera turned off just makes me concerned.

If someone gets into your network I can assure you that they will not be interested in your camera. They will be much more interested in getting into your PCs in order to steal your bank details and your money, or turning your node-red into a spambot. Once they are into your network you are in big trouble so I wouldn't worry about the camera. Just make sure you don't have any ports open in the router and you have disabled router access via the internet port. Also make sure your wifi uses WPA not WEP.

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [20 April 2021 15:22 UTC](https://discourse.nodered.org/t/http-request-fails/44460/11 "2021-04-20T15:22:11Z")

</div>

Which type of authentication does the camera require - does it maybe need digest authentication ?

---

<div class="post-metadata">

### Author: ![Randy](https://avatars.discourse-cdn.com/v4/letter/r/2acd7d/32.png) [@Randy](https://discourse.nodered.org/u/Randy)
#### Post date: [20 April 2021 17:20 UTC](https://discourse.nodered.org/t/http-request-fails/44460/12 "2021-04-20T17:20:51Z")

</div>

[http://user:password@cameraip](http://user:password@cameraip) used to be the method. However the posts that I am finding a somewhat dated. Maybe Axis has changed the authentication method in the newer firmware.

I have sent a technical help request to Axis for the current method of http authentication.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [19 June 2021 17:21 UTC](https://discourse.nodered.org/t/http-request-fails/44460/13 "2021-06-19T17:21:42Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
