forked from Agrim-Bansal/InteractiveRobotics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
27 lines (20 loc) · 893 Bytes
/
test.py
File metadata and controls
27 lines (20 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import requests
from flask import Flask, jsonify
app = Flask(__name__)
@app.route('/send_post', methods=['GET'])
def send_post_request():
l=[0.1,0.2,0.05]
url = "http://127.0.0.1:8000/moveobject" # Replace with the actual URL
data = {"object": "Cylinder","l":l} # Data to send
response = requests.post(url, json=data) # Sending JSON data
return jsonify({"status": response.status_code, "response": response.text})
@app.route('/send_post1', methods=['GET'])
def send_post_request1():
l=["Cuboid","Cylinder","Prism"]
url = "http://127.0.0.1:8000/pickup" # Replace with the actual URL
data = {"object": "Cylinder"} # Data to send
response = requests.post(url, json=data) # Sending JSON data
return jsonify({"status": response.status_code, "response": response.text})
if __name__ == '__main__':
print("1")
app.run(port="4000",debug=True)