It just implements the http protocol. You have to study it, to know how post data is transferred. You are setting a content type, payload length, headers and the post data(the file itself). Those parameters and headers are abstracted by the HttpRequest. HttpClient then takes this request and sends it.
I know the http protocol, and HttpClient works just fine for the rest of my code (a lot of GET and POST, including some file download)
The issue, as I said, is that libcurl (which cocos2d::network uses under the hood) allows to “easily” send a file (instead of messing with the post data to re-implement correctly a file upload, which is reinventing the wheel in my books), while HttpClient/HttpRequest do not seem to have this feature.
As I said. You have to send files as post data. They do not have that feature. Files are just binary data and you have to deal with them as post data. So HttpClient/HttpRequest does deal with files
You are correct, that HttpClient/HttpRequest is using curl, but just for doing get/post requests. They are no complete curl wrappers. If you want to use the “easy send file curl feature”, you have to write a curl wrapper or use a third party lib.
HttpClient/HttpRequest was implemented for simple text stuff like utilizing RESTful APIs, not for binary data.
Some things may have to be changed to make it work, because the exact specifications may change depending on the server used. (in particular the content-type and copy name)