Can't post multipart encoded file

with httpx I can’t do that https://2.python-requests.org/en/master/user/quickstart/#post-a-multipart-encoded-file with another URL service

when I use curl it’s ok for the URL service, but not with httpx

eg this works

curl -v -F 'data=@/home/foxmask/Images/cactus.png' -F 'props={"title":"cactus", "filename":"cactus.png"}' http://localhost:41184/resources?token=xxxx

but not this

>>> import httpx
>>> files = {'file': open('/home/foxmask/Images/cactus.png', 'rb')} 
>>> token = 'xxx' 
>>> res = httpx.post('http://127.0.0.1:41184/resources', files=files, params={'token': token}) 
>>> res.text
 '{"error":"Resource cannot be created without a file"}'
>>> res.status_code 
 400

the service seems to not see the size of the file from request.file.length (a JS service)

is there something I missed ?

i try with requests and aiohttp but got the same error number and text

i got help on the discord channel :wink:
the solution is ; the server was waiting for “data” instead of “file” parameter in the files properties + json.dumps() for the parameters