Hi everyone
I am working on an HTTP server on a Cortex-M7 ARM to transmit SOAP messages (with text/xml content) via CGI script, and transmit JSON-AJAX (with application/json content) via CGX script. All HTTP requests are POST requests.HTTP Headers for CGX scripts are automatically generated via the function netCGX_ContentType(void)
const char* netCGX_ContentType (void) { return("application/json; charset=utf-8"); }
Currently, HTTP headers for CGI scripts return a content-type "text/html" instead of "text/xml".According to the documentation Common Gateway Interface, documentation, there is a function to change the content type of an HTTP header. It does not work..(Here's mine function below)
/* Generate http header content-type for cgi call */ const char* netCGI_ContentType (const char *file_ext) { if (strcmp (file_ext, "cgi") == 0) { return("text/xml; charset=utf-8\r\n"); } return(NULL); }
My set-up :
STM32F769I cardVersions:HTTP_Server_FS.c: v7.2.0HTTP_Server_CGI.c: v7.0.0Net_Config.c: v7.7.0 (variant IPv4 / IPv6 Release)Net_Config_HTTP_Server.c: v7.0.0"
Thanks,