-
Notifications
You must be signed in to change notification settings - Fork 5
DataAPI SDK english MT.DataAPI Implementation notes
If the FormData object is available in browser, the DataAPI object sends request body by using the FormData object. As a result, all the POST requests are sent with "multipart/form-data".
If the FormData object is not available in browser, the DataAPI object sends request body with "application/x-www-form-urlencoded".
If "cache" option is true, the DataAPI sends GET/POST request simply.
If "cache" option is false, the DataAPI sends GET/POST request with the "_" parameter. The value of the "_" parameter is the current timestamp (microsecond).
If "crossOrigin" option is true or a DataAPI object detect current environment is cross-origin by document's URL and baseUrl, a DataAPI object sends request by settings of cross-origin. The following behaviors are changed. (If you want to do cross-orign request, you need to add DataAPICORSAllowOrigin to mt-config.cgi.)
A DataAPI object sends a request with "X-Requested-With" header in same-origin environment. But in cross-origin environment, sends a request without "X-Requested-With" header.
Since A XMLHttpRequest object of IE8 and IE9 can not send request in cross-origin environment, A DataAPI object sends a request useing a XDomainRequest object. A XDomainRequest object cannot set custom request header. Therefore, the request that requires authentication cannot be sent. (If you try to send that request, a DataAPI object throws exception.)