angularjs - Angular: why $http GET params encrypted? -
i have get
method reason sends encrypted params
var request = function (apimethod, apiresponse) { var deferred = $q.defer(); var apipath = getapipath(); apipath = $rootscope.root_url + apipath; var config = { method: 'get', url: apipath + apimethod, params: 'email=myemail@gmail.com, timestamp_start=1432801800, timestamp_end=1432803600, organizer_email= myemail@gmail.com, cloudinary_rules=scale, meeting_name=123', //data: apiresponse, //headers: {'content-type': 'application/x-www-form-urlencoded'}, //withcredentials: true, timeout: canceler.promise }; $http.get(config).success(function (data) { $rootscope.showloader = false; if (data.message === undefined) { deferred.resolve(data); } else { deferred.reject(data); } }).error(function (data, status, headers, config) { $rootscope.showloader = false; deferred.reject(data); }); return deferred.promise; };
however request as:
how send proper request?
you should try give him object instead of string :
var config = { method: 'get', url: apipath + apimethod, params: { email:"myemail@gmail.com", timestamp_start:1432801800, timestamp_end:1432803600, [etc...] } //data: apiresponse, //headers: {'content-type': 'application/x-www-form-urlencoded'}, //withcredentials: true, timeout: canceler.promise };
it trying url encode whole string 1 parameter not sure.
hope helped.
edit : haha re-read request.
it taking string array of params. sending each letter 1 param (look params order : 0 : e - 1 : m - 2 : (ema...) [etc...].
Comments
Post a Comment