.. index:: pair: class; EE::Network::Http::MultipartEntitiesBuilder .. _doxid-class_e_e_1_1_network_1_1_http_1_1_multipart_entities_builder: class EE::Network::Http::MultipartEntitiesBuilder ================================================= .. toctree:: :hidden: Overview ~~~~~~~~ Helper class to build the body of a multipart/form-data request. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class MultipartEntitiesBuilder { public: // construction :target:`MultipartEntitiesBuilder`(); :ref:`MultipartEntitiesBuilder`(const std::string& boundary); // methods std::string :ref:`getContentType`(); const std::string& :ref:`getBoundary`() const; void :ref:`addParameter`(const std::string& name, const std::string& value); void :ref:`addFile`(const std::string& parameterName, const std::string& fileName, :ref:`IOStream`* stream); void :ref:`addFile`(const std::string& parameterName, const std::string& filePath); std::string :target:`build`(); }; .. _details-class_e_e_1_1_network_1_1_http_1_1_multipart_entities_builder: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Helper class to build the body of a multipart/form-data request. Construction ------------ .. index:: pair: function; MultipartEntitiesBuilder .. _doxid-class_e_e_1_1_network_1_1_http_1_1_multipart_entities_builder_1aaba971e8b47790336c9209933ac826d2: .. ref-code-block:: cpp :class: doxyrest-title-code-block MultipartEntitiesBuilder(const std::string& boundary) .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - boundary - The boundary to use in the multipart data. Methods ------- .. index:: pair: function; getContentType .. _doxid-class_e_e_1_1_network_1_1_http_1_1_multipart_entities_builder_1ae2ba312cc0de520fa3433fdc78eaad39: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::string getContentType() For example: .. ref-code-block:: cpp Http::Request request; Http::MultipartEntitiesBuilder builder; ... request.setField( "Content-Type", builder.getContentType() ); .. rubric:: Returns: The corresponding request Content-Type needed. This Content-Type header must be set to the request in order to work correctly. .. index:: pair: function; getBoundary .. _doxid-class_e_e_1_1_network_1_1_http_1_1_multipart_entities_builder_1a4a7f7773478b8be40c777d72212f77f4: .. ref-code-block:: cpp :class: doxyrest-title-code-block const std::string& getBoundary() const .. rubric:: Returns: The boundary used to build the multipart data. .. index:: pair: function; addParameter .. _doxid-class_e_e_1_1_network_1_1_http_1_1_multipart_entities_builder_1aac1df3ff4426a7d36eff75847c66e3e5: .. ref-code-block:: cpp :class: doxyrest-title-code-block void addParameter(const std::string& name, const std::string& value) Adds a text multipart form field. .. index:: pair: function; addFile .. _doxid-class_e_e_1_1_network_1_1_http_1_1_multipart_entities_builder_1a459e129f24dfd2d6c4c5f58f3fa925c4: .. ref-code-block:: cpp :class: doxyrest-title-code-block void addFile(const std::string& parameterName, const std::string& fileName, :ref:`IOStream`* stream) Adds a file to the multipart data. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - parameterName - The field name. * - fileName - The file name of the stream. * - stream - The stream were the file is located and is going to be read. .. index:: pair: function; addFile .. _doxid-class_e_e_1_1_network_1_1_http_1_1_multipart_entities_builder_1a0e1439861344f650767be4dd7e892f22: .. ref-code-block:: cpp :class: doxyrest-title-code-block void addFile(const std::string& parameterName, const std::string& filePath) Adds a file to the multipart data. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - parameterName - The field name. * - filePath - The local file path.