Hi,
I'm having a problem uploading an image to a REST-api.
I get the following error Body contentType 'multipart/form-data;boundary=---------------------------1461124740692' not supported
This is the code I'm using:
I've tried several ContentTypes, but i cannot get it working.
What am i doing wrong?
Thx for some help
I'm having a problem uploading an image to a REST-api.
I get the following error Body contentType 'multipart/form-data;boundary=---------------------------1461124740692' not supported
This is the code I'm using:
B4X:
Dim j As HttpJob
j.Initialize("", Me)
Dim fd As MultipartFileData
fd.Initialize
fd.KeyName = "Content"
fd.Dir = Provider.SharedFolder
fd.FileName = tempImageFile
fd.ContentType = "application/octet-stream"
j.PostMultipart(Main.BaseUrl & "projects/files/upload_image", CreateMap( "hash": "Test","user": "Hallo"), Array(fd))
j.GetRequest.SetHeader("Authentication", "bearer " & Main.Token)
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
Log(j.GetString)
End If
j.Release
I've tried several ContentTypes, but i cannot get it working.
What am i doing wrong?
Thx for some help