diff --git a/.gitignore b/.gitignore index 2f22d72..07d5730 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /data /target +/venv \ No newline at end of file diff --git a/examples/upload.py b/examples/upload.py new file mode 100644 index 0000000..ba6e516 --- /dev/null +++ b/examples/upload.py @@ -0,0 +1,21 @@ +import requests + +with open("./example.jpeg", "rb") as file: + image = file.read() + +r = requests.post( + "http://127.0.0.1:8000/v1/user-profiles", + params={"format": "jpeg"}, + headers={ + "content-length": str(len(image)), + "content-type": "application/octet-stream" + }, + data=image, +) + +r.raise_for_status() +data = r.json() + +print("My image id: {}", data['image_id']) +print("It took {}s to complete!", data['processing_time']) +print("And has a checksum of {}!", data['checksum'])