Hi,
You can upload a file without multipart/form_data encoding.
The http_request class has a set_body() overload that takes a Casablanca input stream. This input stream can be a file stream, pointing to the file to be uploaded.
By default, the content-type is set to "application/octet-stream", however you could change that to any other content-type.
I would suggest glancing through the test case: set_body_stream_1 and set_body_stream_2 at https://casablanca.codeplex.com/SourceControl/latest#Release/tests/Functional/http/client/request_stream_tests.cpp
These tests create an http_client, create an http_request for the POST request, set casablanca::streams::istream (to a file) as the body of the http_request.
On calling http_client::request(), the file is uploaded to the server.
Let me know if you have further questions.
Thanks
Kavya
You can upload a file without multipart/form_data encoding.
The http_request class has a set_body() overload that takes a Casablanca input stream. This input stream can be a file stream, pointing to the file to be uploaded.
By default, the content-type is set to "application/octet-stream", however you could change that to any other content-type.
I would suggest glancing through the test case: set_body_stream_1 and set_body_stream_2 at https://casablanca.codeplex.com/SourceControl/latest#Release/tests/Functional/http/client/request_stream_tests.cpp
These tests create an http_client, create an http_request for the POST request, set casablanca::streams::istream (to a file) as the body of the http_request.
On calling http_client::request(), the file is uploaded to the server.
Let me know if you have further questions.
Thanks
Kavya