Body serialization
kptLucek opened this issue · 3 comments
kptLucek commented
Hi
Is there any chance to change way, that body is being serialized?
Right now it's made by JSON.stringify
, but... it resuts in many problems with backend API im using for that project.
The perfect way for me, would be to choose between stringify
and for example URLSearchParams
(aka, NG1 $httpParamSerializer) described in here.
If it's not possible to implement any soon, then any workaround more than welcome.
troyanskiy commented
Hello!
Thanks for the issue.
I've just implemented that for you. Published 3.3.0
- You can overwrite
Resource
method$bodySerializer(body: any): string
to implement customs serializer. - Or you can define if with
ResourceAction
decoratorbodySerializer(body: any): string
to implement custom serializer per resource method.
kptLucek commented
Works like a charm!
troyanskiy commented
I'm glad to hear that.