I am trying to send a json file, but I get an error: “ResponseError. Reason: Bad Request, Response: <h1> Bad Request (400) </h1> "
Moreover, if I send the same file via postman, everything comes up fine.
Here is my code:
What am I doing wrong?
Moreover, if I send the same file via postman, everything comes up fine.
Here is my code:
B4X:
Dim fd As MultipartFileData
fd.Initialize
fd.KeyName = "data"
fd.Dir = File.DirInternal
fd.FileName = "1.json"
fd.ContentType = "application/json"
j.PostMultipart("link", CreateMap("data": "1.json"), Array(fd))
j.GetRequest.SetContentType("multipart/form-data")