MCPcopy Create free account
hub / github.com/dcloudio/mui / serializeData

Function serializeData

js/mui.ajax.js:77–93  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

75 });
76 };
77 var serializeData = function(options) {
78 if(options.processData && options.data && typeof options.data !== "string") {
79 var contentType = options.contentType;
80 if(!contentType && options.headers) {
81 contentType = options.headers['Content-Type'];
82 }
83 if(contentType && ~contentType.indexOf(jsonType)) { //application/json
84 options.data = JSON.stringify(options.data);
85 } else {
86 options.data = $.param(options.data, options.traditional);
87 }
88 }
89 if(options.data && (!options.type || options.type.toUpperCase() === 'GET')) {
90 options.url = appendQuery(options.url, options.data);
91 options.data = undefined;
92 }
93 };
94 var appendQuery = function(url, query) {
95 if(query === '') {
96 return url;

Callers 1

mui.ajax.jsFile · 0.70

Calls 1

appendQueryFunction · 0.70

Tested by

no test coverage detected