I have an image and I want to send it to the serve. I'm using requests module to perform simple post request as following(info is a dictionary):
import requests
print(type(info["array_image"]))
print(type(info["visual_features"]))
response = requests.post("url", data=info)
output :
<class 'numpy.ndarray'>
<class 'torch.Tensor'>
on the server side I'm trying to receive them as arrays at least:
from flask import Flask, request
@app.route('/path', methods=['POST'])
def function_name():
visual_features = request.form['visual_features']
array_image = request.form['array_image']
print(type(array_image))
print(type(visual_features))
output:
<class 'str'>
<class 'str'>
I want to get a bytes array to build the image, but what I'm getting is a string... If I didn't find a way I'll encode arrays in bas64 and then decode it in the server...