Hi,
I am using AJAX JSON over HTTP to send using CGI. It is working. Does Keil web server CGX supports JSON RPC.
Currently I have to Post JSON using CGX using
$.ajax({ type: "POST", url: "xmlHttp.cgx", data: post_data, contentType: "text/xml", datatype : "text", success: function(data) {
}, error: function (xhr, ajaxOptions, thrownError) {
} });
contentType is xml. If I set JSON/application then I do not get cgi_process_data call.
"contentType: "json/application"
Why invent your own MIME type?
Sorry It is
Content-Type: application/json
Should this works with keil.
void cgi_process_data ( U8 code, /* Type of data in received data buffer. */ U8* dat, /* Pointer to the data string from the POST method. */ U16 len ); /* Number of bytes in the data string. */
Content-Type: application/json is not working.
I can cheat Keil by either not specifying Content-Type at all then I get code =0 or specify Content-type : text/xml then I get code =4
In both cases it is alight which is I can post/send json data and then I can parse json data but It is not strictly Content-Type: application/json which I am looking.
Only issue is post. response of post is good I can specify "application/json" by override for response.
const char *netCGX_ContentType (void) { return ("application/json"); }
Any thoughts how we can fix it or this is limitation of Keil.
Another question. I cannot find any keil HTTP functions to get request URL. I may like to do RestFul style ajax calls in this case I need to differentiate which method is requested by parsing URL.
As noted from previous post:
This has been changed recently. Now cgi_process_data() is called on any POST data, not only xml. Please ask support for the updated version. http://www.keil.com/support/man/docs/rlarm/rlarm_cgi_process_data.htm
So - have you asked support for the updated version?
I have not ask for updated Keil Middle ware. I have updated my Keil version 5 components which fetch update components over internet from within Keil IDE.
Is there separate process to get manual update from Keil then Kindly let me know how I can get update?
I do have license.
Don't you think Keil's message indicates that they haven't officially released that new version yet? So you can't get it by just retrieving the most recent released version.
"Is there separate process to get manual update from Keil then Kindly let me know how I can get update?"
How about by please asking Keil support for the updated version? Or exactly what do you think Keil staff means when they write "Please ask support for the updated version."???
Thanks for your information.
How I can trigger get cgi_process_data code == 5 because I need to return large JSON response which does not fit into Ethernet/TCP/IP single packet. It is more than 1400 bytes.
www.keil.com/.../rlarm_cgi_process_data.htm
Do I need to call AJAX with special parameters.