troyanskiy / ngx-resource

Resource (REST) Client for Angular 2
http://troyanskiy.github.io/ngx-resource/
200 stars 46 forks source link

Send array of params joined by & #221

Open mirabu2801 opened 1 year ago

mirabu2801 commented 1 year ago

Hello! I need to send a query param, whose value is an array I need to send it in the format ?param=val1&param=val2. Is there a way to do this?

josencv commented 1 year ago

I think the closest would be using the Bracket query mapping strategy of the lib:

ResourceGlobalConfig.queryMappingMethod = ResourceQueryMappingMethod.Bracket;

But then you'll need to pass the parameters adding [n] (url encoded) after the param name: ?param%5B0%5D=val1&param%5B1%5D=val2.