nn::http::Connection::SetLazyPostDataSetting Member Functionnn::Result SetLazyPostDataSetting( PostDataType dataType );
| Name | Description | |
|---|---|---|
| in | dataType | Type of the POST data. |
Result values listed below.| Value | Description |
|---|---|
Result::IsSuccess |
Process was successful. |
ResultPostAddedAnotherErr |
POST data was configured using a setter before the Connect method was called. When calling this function, be sure to avoid conflicts with these POST data settings. (To reconfigure POST data, first call the Connection object'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 that no target URL was assigned to the Connection object. No action is performed because the Connection object has not been initialized by a successful call of 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). |
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.
CONFIDENTIAL