Android Question How to Sent json string as multipartfiledata

gvoulg

Member
Licensed User
Longtime User
Hi
I want to sent a json string saved in a file (json.txt) , as multipartfiledata with Postmultipart process.
I have seen this code snippet for image file
B4X:
Dim j As HttpJob
j.Initialize("j", Me)
Dim fd As MultipartFileData
fd.Initialize
fd.KeyName = "file"
fd.Dir = File.DirAssets
fd.FileName = "image.png"
fd.ContentType = "image/png"
j.PostMultipart("http://...", CreateMap("param1": "value1"), Array(fd))
How should I define contentType and keyname ?
George
 
Top