I am sending some image data to backened server. The problem is that, for the same code the request payload is different at our different server.
So i am making an request like this :
sign_type.push("string");
And adding this to fields like this :
fields.sign_type = sign_type;
fields.image_data = imageDataArray;
And making call like this :
Upload.upload({
url: 'api/test',
method: 'POST',
file: files,
imageData: imageDataArray,
fileName: filesName,
fields: fields,
fileFormDataName: 'file'
}).success(function (response, status, headers, config) {
//
}).error(function (data, status, headers, config) {
});
But the problem is that for this same code i get different request payload at different server :
Server 1 (Working fine)
------WebKitFormBoundaryIWviAIcICxBA9gts Content-Disposition: form-data; name="sign_type[0]"
string
------WebKitFormBoundaryIWviAIcICxBA9gts Content-Disposition: form-data; name="sign_type[1]"
string
------WebKitFormBoundaryIWviAIcICxBA9gts Content-Disposition: form-data; name="image_data[0]"
Sever 2( not working) :
------WebKitFormBoundaryWb0UyBYCZAa6YGAG Content-Disposition: form-data; name="sign_type"
["string","string"]
------WebKitFormBoundaryWb0UyBYCZAa6YGAG Content-Disposition: form-data; name="image_data"