#include <dwc.h>
BOOL DWC_GHTTPPostAddString( DWCGHTTPPost* post,
const char* key,
const char* value );
This function adds data to be uploaded to the HTTP server to a DWCGHTTPPost type object. A DWCGHTTPPost type object is an information unit used to upload data to the HTTP server. It is created by the DWC_GHTTPNewPost function.
Data is uploaded to the HTTP server after setting the key string and the value string. The key string and value string are copied and stored in the library. Also, both strings must be terminated with the NULL character.
Use the DWC_PostGHTTPData or DWC_GetGHTTPDataEx2 function to actually start data upload.
The sample program below shows an example string as data to be sent to the HTTP server.
"key1=value1&key2=value2"
When more data is added to the same DWCGHTTPPost type object, a string like the one below is added.
"key1=value1&key2=value2&key3=value3&key4=value4...quot;
DWCGHTTPPost post;
// Creates DWCGHTTPPost type objects
DWC_GHTTPNewPost( &post );
// Sets the data to be uploaded to a DWCGHTTPPost type object
DWC_GHTTPPostAddString( &post, "key1", "value1" );
DWC_GHTTPPostAddString( &post, "key2", "value2" );
post |
Pointer to the DWCGHTTPPost type object to which data is added. |
key |
String to display the name of the data to be added. Neither NULL nor an empty string "" can be specified. |
value |
String of the actual data to be added. If NULL is specified, the empty string will be the data. |
TRUE |
Data successfully added. |
FALSE |
Failed to add data due to a parameter error or a memory allocation error. |
DWC_GHTTPNewPost, DWC_PostGHTTPData, DWC_GetGHTTPDataEx2
2006/12/27 Made revisions in line with the addition of the DWC_GetGHTTPDataEx2 function
2006/01/18 Support for changing return values to BOOL. Added conditions to the key argument. 2005/12/16 Added a usage example of the function.
2005/10/27 Initial version.
CONFIDENTIAL