URL I am using: https://mydomain--stg1.my.salesforce.com/services/data/v57.0/sobjects/ContentVersion
I am passing headers like:
Then I have created a json file as mentioned in : https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_insert_update_blob.htm
Here is the file I have named as "NewContentVersion.json" and I am uploading it as binary body attachment :
--boundary_string Content-Disposition: form-data; name="entity_content"; Content-Type: application/json
{"Title":"test","PathOnClient":"test.pdf","FirstPublishLocationId":"5008I0000062dqV"}
--boundary_string Content-Type: application/octet-stream Content-Disposition: form-data; name="VersionData"; filename="test.pdf"
255044462d312e370d0a25a1b3c5d70d0a312030206f626a0d0a3c3c2f5061676573203220302052202f547970652f436174616c6f673e3e0d0a656e646f626a0d0a322030206f626a0d0a3c3c2f436f756e7420322f4b6964735b2034203020522020333520302052205d2f547970652f50616765733e3e0d0a656e646f626a0d0a332030206f626a0d0a3c3c2f4372656174696f6e4461746528443a3230323330333331313630373535292f43726561746f722850444669756d292f507262031203020520d0a2f496e666f2033203020520d0a2f53697a652033372f49445b3c31414239384435464141373536444538463338333037334241354345444337303e3c31414239384435464141373536444538463338333037334241354345444337303e5d3e3e0d0a7374617274787265660d0a3136323534390d0a2525454f460d0a......and so on (Base64 encoded string) --boundary_string--
-------------------------xxxxxxxxxxxxxxxxx--------------------------------------------
Updating question based on SfdcFox comment, I am using dcode.fr/file-data#f1 "Binary 00000000-11111111" file reader option to get binary data like "00100101 01010000 01000100 01000110 and so on". But what parameters i need to pass in form-data? :