How can i send image file to API?
I want to use customvision.ai API.
How can i send image file to API?
I want to use customvision.ai API.
Use the Web Component.
Set URL as Web URL you Headers should look like this:
And then use Post or Put File to upload the Image. Make sure you set the whole Image Path.
Test it with „do it“ if it the full path.
The API needs the full Path from you Phone.
What is your android version?
I sent it with full path. but I am getting an interesting error.
Error:1104
[I can use the API with python without any problems.]
Some API I tested can’t do it to on Kodular. I can’t say why it isn’t working in some Cases.
Did you tried to use the ASD Folder?
I can do it in 4 lines with python. But I couldn’t do it with blocks. please help. How can I send a file to the API.
import requests, json
url="https://southcentralus.api.cognitive.microsoft.com/customvision/v3.0/Prediction/d96305a9-8d18-4ac3-8f37-a5e493ce6243/classify/iterations/Iteration1/image"
headers={'content-type':'application/octet-stream','Prediction-Key':'06d4a646232c4091884e1e98cd4a253b'}
r =requests.post(url,data=open("test.jpg","rb"),headers=headers)
print(r.content)
ML2 (1).aia (2.8 KB)
Is there any Documentation for your API?
We can help you without API Documentation.
@Ded_Sec_00 Thank you for your interest in the subject.
Microsoft Custom Vision API Documentation:
i think, this API need image in Binary content. but I don’t know how to convert it.
my Dropbox example also uses Content-Type octet-stream and works fine with an image
https://puravidaapps.com/dropbox.php
are you able to display the image in an image component?
make sure the path to the image is correct… try a relative path, for example /DCIM/Camera/...
or a full path, for example file:///storage/emulated/0/DCIM/Camera/...
(note the 3 slashes…)
Taifun