hyttekamera/upload_img.py
2022-01-18 15:13:17 +01:00

11 lines
264 B
Python

from flask import Flask, request, jsonify
import requests
url = 'http://127.0.0.1:5000/post_img'
my_img = {'image': open('/home/trygve/Pictures/boiled.png', 'rb')}
r = requests.post(url, files=my_img)
# convert server response into JSON format.
print(r.json())