Hello!
I have a Python script that sends an API request to a Docker connection.
Unfortunately I don’t know how to execute this API request in UiPath, can someone help me here?
The Python script looks like this:
from PIL import Image, ImageOps
from PIL import ImageDraw
import base64
from io import BytesIO
import requests
import json
filename = "File.txt
byteImg = Image.open(filename)
byteImg = ImageOps.exif_transpose(byteImg)
byteImgIO = BytesIO()
byteImg.save(byteImgIO, “JPEG”)
bio = byteImgIO.getvalue()
bio64 = base64.b64encode(bio)
sbio64 = bio64.decode(‘utf-8’)
url = ‘http://123’
payload = ‘{ “preprocess”: “True”, “postprocess”: “Front”, “image” : “%s” }’ %sbio64
headers = {“accept”: “application/json”}
response = requests.post(url, data=payload, headers=headers)
get = requests.get(url, data=payload, headers=headers)
So now I need this API request in UiPath
Ich habe ein Python Script das einen API Request an eine Dockeranbindung sendet.
Leider weiß ich nicht, wie ich diesen API Request nun in UiPath durchführe, kann mir hier jemand helfen?
Das Python Script sieht so aus:
from PIL import Image, ImageOps
from PIL import ImageDraw
import base64
from io import BytesIO
import requests
import json
filename = “File.txt”
byteImg = Image.open(filename)
byteImg = ImageOps.exif_transpose(byteImg)
byteImgIO = BytesIO()
byteImg.save(byteImgIO, “JPEG”)
bio = byteImgIO.getvalue()
bio64 = base64.b64encode(bio)
sbio64 = bio64.decode(‘utf-8’)
url = ‘http://123’
payload = ‘{ “preprocess”: “True”, “postprocess”: “Front”, “image” : “%s” }’ %sbio64
headers = {“accept”: “application/json”}
response = requests.post(url, data=payload, headers=headers)
get = requests.get(url, data=payload, headers=headers)
Jetzt brauche ich also diesen API Request in UiPath