Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Bonjour,
Je rencontre des difficultés avec tRestClient pour envoyer un fichier .txt via une API REST.
Mon besoin :
envoyer un fichier (texte tabulé \t)
soit en binaire (text/plain / application/octet-stream)
soit en multipart/form-data
Problème :
Content-Type limité à JSON / XML / FORM
impossible d’envoyer un fichier en multipart (pas de paramètre de type file)
pas de gestion simple du binaire
réponse en type Document non modifiable
Question :
Existe-t-il une solution ou un contournement pour envoyer un fichier avec tRestClient, ou faut-il passer par un autre composant ?
Merci pour vos retours
Hello anyxs,
Yes, this is a known limitation of TRESTClient/TRESTRequest. They are designed mainly for JSON/XML, not raw binary or proper multipart/form-data file uploads. There is no clean or reliable workaround in TRESTClient itself for sending files.
We recommend using TNetHTTPClient / THTTPClient.
These fully support:
Hello anyxs,
Yes, this is a known limitation of TRESTClient/TRESTRequest. They are designed mainly for JSON/XML, not raw binary or proper multipart/form-data file uploads. There is no clean or reliable workaround in TRESTClient itself for sending files.
We recommend using TNetHTTPClient / THTTPClient.
These fully support: