angularjs - Difference between $httpParamSerializerJQLike and $httpParamSerializer -
i dont understand main difference between $httpparamserializerjqlike , $httpparamserializer , when can use 1 of them.. 1 me.. ?
old question, looking today , found answer somewhere else:
link:
in general, seems $httpparamserializer uses less "traditional" url-encoding format $httpparamserializerjqlike when comes complex data structures.
for example (ignoring percent encoding of brackets):
with array property of data object such {sites:['google', 'facebook']}
:
- $httpparamserializer return
sites=google&sites=facebook
- $httpparamserializerjqlike return
sites[]=google&sites[]=facebook
with object property of data object such {address: {city: 'la', country: 'usa'}}
:
- $httpparamserializer return
address={"city": "la", country: "usa"}
- $httpparamserializerjqlike return
address[city]=la&address[country]=usa
Comments
Post a Comment