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:

https://myapp.me/api.php/get_gadget_notes?0=e&1=m&10=a&100=d&101=a&102=c&103=o&104=r&105=p&106=@&107=g&108=m&109=a&11=c&110=i&111=l&112=.&113=c&114=o&115=m&116=,&117=+&118=c&119=l&12=o&120=o&121=u&122=d&123=i&124=n&125=a&126=r&127=y&128=&129=r&13=r&130=u&131=l&132=e&133=s&134=%3d&135=s&136=c&137=a&138=l&139=e&14=p&140=,&141=+&142=m&143=e&144=e&145=t&146=i&147=n&148=g&149=&15=@&150=n&151=a&152=m&153=e&154=%3d&155=1&156=2&157=3&16=g&17=m&18=a&19=i&2=a&20=l&21=.&22=c&23=o&24=m&25=,&26=+&27=t&28=i&29=m&3=i&30=e&31=s&32=t&33=a&34=m&35=p&36=&37=s&38=t&39=a&4=l&40=r&41=t&42=%3d&43=1&44=4&45=3&46=2&47=8&48=0&49=1&5=%3d&50=8&51=0&52=0&53=,&54=+&55=t&56=i&57=m&58=e&59=s&6=l&60=t&61=a&62=m&63=p&64=&65=e&66=n&67=d&68=%3d&69=1&7=a&70=4&71=3&72=2&73=8&74=0&75=3&76=6&77=0&78=0&79=,&8=n&80=+&81=o&82=r&83=g&84=a&85=n&86=i&87=z&88=e&89=r&9=d&90=_&91=e&92=m&93=a&94=i&95=l&96=%3d&97=l&98=a&99=n

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

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -