nn::http::Connection::SetLazyPostDataSetting Member Function

Syntax

nn::Result SetLazyPostDataSetting(
     PostDataType dataType
);

Arguments

Name Description
in dataType Type of the POST data.

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 using the legacy configuration API for the Connect class. 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.)
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.)
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

Sets the "lazy" (delayed) POST data configuration mode. (Here, "lazy mode" refers to the mode used to specify data after Connect is called.)

Once this function is called, the lazy POST data configuration mode becomes possible. (With lazy mode, you can use one of the SendPostData×× functions to set data after Connect or ConnectAsync is run.)

When POST data is set to lazy mode, you can call one of the SendPostData×× functions as many times as you like after calling either Connect or ConnectAsync.
The POST data is sent synchronously using one of the SendPostData××() functions. Consequently, SendPostData×× will block until the send is complete.
Once you have finished configuring all of the POST data, you must run NotifyFinishSendPostData.

After running the NotifyFinishSendPostData function, the library moves on to receiving the HTTP response.

nn::http::POST_DATA_TYPE_URLENCODE: If the data that was set is ASCII-encoded (in other words, if SendPostDataAscii was used to set it), the data is URL-encoded and then sent.
Either SendPostDataAscii or SendPostDataBinary can be used as the SendPostData×× function.
If SendPostDataAscii was used, the data that is sent is URL-encoded data in which [<labelName>=<data content>].
If SendPostDataBinary was used, the data that is sent is non-URL-encoded data in which [<labelName>=<data content>]. The labels and data that are set during a single call to SendPostData×× are grouped into a single piece of chunked data and then sent.


nn::http::POST_DATA_TYPE_MULTIPART: The data that is set is sent as multipart MIME data.
Either SendPostDataAscii or SendPostDataBinary can be used as the SendPostData×× function. The labels and data that are set during a single call to SendPostData×× are prepended with boundary data and header fields, then grouped into a single piece of chunked data before being sent.
The label data that is configured is set as the name attribute of the Content-Disposition field.
(In other words, a header field of the form "Content-Disposition:form-data; name=[Label]" is added after the boundary data in the chunked data.)If any labels and data were configured using the SendPostDataBinary function, a Content-Type field is added after the boundary data of the chunked data.
(In this case, the field's content is "Content-Type:application/octet-stream\r\nContent-Transfer-Encoding:binary\r\n". Data that was set using the SendPostDataAscii function does not have this field added to the chunked data.)


nn::http::POST_DATA_TYPE_RAW: Any data that is set is sent as is. Only SendPostDataRaw can be used as the SendPostData×× function for this data type.
The data that is set during a single call to SendPostDataRaw are grouped into a single piece of chunked data and then sent.

Revision History

2010/06/14
Initial version.

CONFIDENTIAL