Posting a picture with libURLFormData
Posted: Thu Oct 21, 2021 10:05 pm
Hi guys, 4 days and counting since I started to try to use a cURL method in order to upload a picture to a service provider...
Anyway now I'm at a point that the error message I'm getting seems to tell me something about what I'm doing wrong but I'm stupid enough to not being able to understand it...
this is my code
and the error i'm getting
Thanks
Anyway now I'm at a point that the error message I'm getting seems to tell me something about what I'm doing wrong but I'm stupid enough to not being able to understand it...
this is my code
Code: Select all
-- build the body
put "bbb" into tphoto_id
put "aaa" into tvisit_id
put "ccc" into tscene_id
put "<file>" & "/Users/simonschvartzman/Downloads/Pic1.jpg" into tFile
-- build the call
get libURLFormData("visit_id", tvisit_id, "scene_id", tscene_id, "photo_id", tphoto_id, "photo_data", tFile)
put it into aux
-- fire the post
post aux to url tURL
put it into tResponse
Any ideas of what am I doing wrong?{"type":"error","message":"1 validation error for Request\nbody -> photo_data\n Expected UploadFile, received: <class 'str'> (type=value_error)","status":422}
Thanks