Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

ofLoadURL 401 Unauthorized Error

$
0
0

@Bentley wrote:

Hey oF community. I'm trying to send a command to a network camera on my local network. The brand of the camera is Axis if anyone is interested (they make great cameras!)

I have the correct http request which I can use to control the camera via a web browser like chrome: http://192.168.100.32/axis-cgi/virtualinput/deactivate.cgi?schemaversion=1&port=1

This is a really simply command and it just deactivated a virtual port which I then use to control some other stuff on the camera.

Ideally I'd like to have an oF app which allows me to toggle this setting on the camera via a button so I'm using the following code to control it which should send the web request:

ofLoadURL("http://192.168.100.32/axis-cgi/virtualinput/deactivate.cgi?schemaversion=1&port=1");

However this does not set the correct setting on the camera and returns the following as an HTTP response:

<html><head>
<title>401 Unauthorized</title>
</head><body>
<h1>Unauthorized</h1>
<p>This server could not verify that you
are authorized to access the document
requested.  Either you supplied the wrong
credentials (e.g., bad password), or your
browser doesn't understand how to supply
the credentials required.</p>
</body></html>

I've tried adding the username and password to the html request like so: http://192.168.100.32/axis-cgi/virtualinput/deactivate.cgi?schemaversion=1&port=1. But this still returns the same error (it's worth noting this request also works in the browser).

I'm going to open a ticket with the camera supplier to see if the issue is something I can resolve via the request but it's also possible that by using oF my "Browser" doesn't know how to deliver the correct credentials.

Has anyone run in to something like this before or have any advice on how oF passes credentials to a web server?

Thanks!

JB

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles