I have to impement an API and the documentation is as follows:
I never send an image via binary file in an API call.
The various xojo codes chatgtp suggested to me I didn`t have conditions to make them work.
Someone could give me some advice about how to do it ?
I will ask you if you please would check my code in order to find what I am implementing wrong in order to receive from the API the right response.
You could find the project in the following link, including the image to be used: Dropbox Link
THANKS !!!
Try adding the image data as a string instead of a file:
Dim file As FolderItem = getfolderitem("").child("food.png")
Dim multipartContent as MultipartFormDataContent = new MultipartFormDataContent()
Dim bs As BinaryStream = BinaryStream.Open(file)
Dim imgdata As String = bs.Read(bs.Length)
bs.Close
multipartContent.Add("image",imgdata) ' string instead of file
@Andrew_Lambert , thank you VERY much.
People like you makes this forum an amazing one.
I am so happy to had choosen XOJO as my main programming language for my company in first place because of the people that participates in the forum. Friendly, always willing to help, responding in record time.
This also is for @AlbertoD and for many many others.
I mention only you two guys because you ansewer this particular topic, but the forum is full of people with these same qualities.
THANKS