How to do HTTP Request
CompletedWe have created our Python web server on localhost and in that server, we are using the action "DoHTTP(S) Request" and the HTTP(S) URL is "http://127.0.01:5000/event_trigger" using "motion on camera" at "start" and the interval of action is "instant" but are not getting any response on the Python web server from NX Witness. We are using content-type "text/plain" and the request method is "Post". We have also confirmed that the Web server is working fine using the "Potman app". So can you tell us what we are doing wrong in it or how we can use the http request?
-
Have you tested with a soft trigger first?
I see the camera is showing offline so you may be hitting unrelated issues.
Otherwise maybe get the generated cURL from postman for us to look at?
0 -
Yes, I have tested the HTTP request with a soft trigger also but it did not show any notification. The camera is showing offline because I was not connected to the camera at that time but when I was testing it the camera was connected with me.
0 -
curl --location 'http://127.0.0.1:5000/event_trigger' \
--header 'Content-Type: text/plain' \
--data 'heyy'@Jaemyn Kinney cURL of the postman
0 -
Hello,
Let's make the test stupid simple. Please follow the instructions below. Those worked just fine for me in my Linux machine. Please use the tescamera for emulating a camera device. The testcamera binary is located in the mediaserver binary direcory. In Linux, it's /opt/networkoptix/mediaserver/bin/testcamera
1. Create a simple TCP server with the netcat utility. Type in the terminal window
nc -l 5000
2. Create a Soft Trigger rule in the GUI like this.
3. Open the camera on the scene. And click the soft trigger icon.
4. See the output in the terminal window. Here is mine.
Please, share a screencast with your process and resulting output.
Please provide the build number of the Server.
0 -
I want to ask how can we create the HTTP request using the windows.
0 -
When you tested:
- Was postman on the same machine that was running the service you were connecting to?
- Was NX on the same machine. This could be a simple firewall issue.
- From the NX server you could run a test net from powershell.
0 -
Yes the postman and NX are on the same machine
0 -
Tried using a non loopback IP of your host?
So are you running a closed single PC environment?
If not, double check the machine with the NX Server can reach the PC with the python server.Can you get a Get request working?
0 -
Hey Paawan, did that work?
0
Please sign in to leave a comment.
Comments
9 comments