nn::http::Connection::AddPostDataBinary Member Function

Syntax

nn::Result AddPostDataBinary(
     const char * pLabel,
     const void * pValue,
     size_t valueSize
);

Arguments

Name Description
in pLabel Label name of the data.
in pValue Data content.
in valueSize Data size of pValue.

Return Values

Returns the function's execution result. Returns a Result listed below.
Value Description
ResultSuccess Process was successful.
ResultPostAddedAnotherErr POST data has already been configured. The function returns this value when POST data of a different type has already been configured, or if adding POST data when in the SetLazyPostDataSetting mode. Use this function carefully to not conflict with such POST data configuration. (To reconfigure POST data, first call the Connection class's Finalize function, and then call Initialize again.)
ResultOutOfMemoryErr Could not allocate POST data buffer from the buffer configured by the nn::http::Initialize function. Adjust the total size of the POST data being registered simultaneously to fit within the the buffer configured by the nn::http::Initialize function.
ResultConnectionStatusErr Error indicating an invalid state. This function cannot be called in the current communication state. (For example, the function returns this error if the system is already connected. You must call this function before calling Connect.)
ResultInvalidParamErr Error indicating an invalid parameter. Specify valid values for all parameters and call this function again.
ResultNotConnectedErr Error indicating a Connection class instance for which the target URL is not assigned. The function has not done anything as it has been called on a Connection instance for which you have not yet successfully called Initialize.
ResultNotInitializedErr Error indicating that the library is not initialized. None of this library's functions can be used until you first call nn::http::Initialize.
A value other than the above. Unexpected error (See http_Result.h for details).

Description

Function used to configure binary POST data before Connecting.

Adds POST data (binary data) to send through an HTTP request.
Use this function for settings before running Connect.
The POST data is sent by running the Connect function after configuring the settings.
If data with the same label has already been added before the call to this function, this function updates the data.
(In other words, if data with the same label is added twice, the old value is deleted before the new value is added.)

If any of the data is set with AddPostDataBinary, all POST data is sent without being encoded.
(In this case, the Content-Type value in the HTTP header is set to "multipart/form-data".)

Revision History

2010/06/14
Initial version.

CONFIDENTIAL