| Description | The http_get_content_type function returns a pointer to the Content-Type html header, which was received in the xml post request. You can use this function to check for the content type, which was submitted by the Silverlight web service application The http_get_content_type function is a system function that is in the RL-TCPnet library. The prototype is defined in net_config.h. note - When a Silverlight web service application sends a request to a web server, it specifies the Content-Type in the HTTP header that is sent to the web server. This information is processed by TCPnet and stored internally.
|
| Example |
void cgi_process_data (U8 code, U8 *dat, U16 len) {
U8 *pType;
switch (code) {
case 4:
/* XML encoded content type, last packet. */
pType = http_get_content_type ();
if (strcmp (pType,"text/xml; charset=utf-8") == 0) {
/* 'utf-8' character set */
..
}
else {
/* Not 'utf-8' */
..
}
return;
case 5:
/* XML encoded as under 4, but with more to follow. */
return;
default:
/* Ignore all other codes. */
return;
}
}
|