24 lines
765 B
Python
24 lines
765 B
Python
|
|
import os
|
|
import requests
|
|
|
|
#url = 'http://192.168.178.85:8000/api/postImage/'
|
|
#url = 'http://127.0.0.1:8000/api/postImage/'
|
|
|
|
path_img = '/home/elena/Documents/Projects/ReceipeScanner/Server/testbild.jpg'
|
|
'''
|
|
with open(path_img, 'rb') as img:
|
|
name_img = os.path.basename(path_img)
|
|
files= {'uploadedFile': (name_img,img,'multipart/form-data',{'Expires': '0'}) }
|
|
with requests.Session() as s:
|
|
r = s.post(url,files=files)
|
|
print(r.status_code)
|
|
'''
|
|
#url = 'http://192.168.178.85:8000/api/scanner/receipeComplete/'
|
|
#url = 'http://192.168.178.85:8000/api/scanner/processAgain/'
|
|
url = 'http://127.0.0.1:8000/api/scanner/processAgain/'
|
|
|
|
with requests.Session() as s:
|
|
r = s.post(url,data={'filename':'receipe-upload-_oqp9us3.jpg'})
|
|
print(r.status_code)
|