Question: I am working on making POST REST API statements to a thingworx server in the first picture is my code and the second picture is

I am working on making POST REST API statements to a thingworx server in the first picture is my code and the second picture is the response i get back. Can someone explain what i did wrong and what would also be the proper way to do this in a C/C++ enviroment?

I am working on making POST REST API statements to a thingworxserver in the first picture is my code and the second picture

Flle Edit labs Help Three door sensor s Thonny - /home/pi/Camera&Contact py 13.1 File Edit View Run Tools Help Camera&Contact py X camera and motion.pyX import RPi.GPIO as GPIO import time import requests import json from picamera import PiCamera GPI0.setwarnings(False) GPIO.setmode (GPIO.BOARD) GPIO.setup (11, GPIO.IN) camera PiCamera() url 'https://academic-educatorsextension.portal ptc.io' headers 'Content-Type: 'application/json, appKey 077c9a51-c690-4d2a-9254-3568cb0ee6bd payload'Detection: True' 1-0 while True: state GPIO.input (11) if state0: print "we're clear" time.sleep (5) elif state-: print "stop Right There! camera.capture /home/pi/PIR/pics/image (0:04d).jpg .format (1)) response-request s. put ( url +?Things/Motion sensor-Coldstee185/*. time.sleep(5) headers -headers, json-payload, verify -False) Shell 92 Flle Edit labs Help Three door sensor s Thonny - /home/pi/Camera&Contact py 13.1 File Edit View Run Tools Help Camera&Contact py X camera and motion.pyX import RPi.GPIO as GPIO import time import requests import json from picamera import PiCamera GPI0.setwarnings(False) GPIO.setmode (GPIO.BOARD) GPIO.setup (11, GPIO.IN) camera PiCamera() url 'https://academic-educatorsextension.portal ptc.io' headers 'Content-Type: 'application/json, appKey 077c9a51-c690-4d2a-9254-3568cb0ee6bd payload'Detection: True' 1-0 while True: state GPIO.input (11) if state0: print "we're clear" time.sleep (5) elif state-: print "stop Right There! camera.capture /home/pi/PIR/pics/image (0:04d).jpg .format (1)) response-request s. put ( url +?Things/Motion sensor-Coldstee185/*. time.sleep(5) headers -headers, json-payload, verify -False) Shell 92

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!