I want to make a request to a route that has an "&" character in it. Moya by default will not encode this character, so for example if my custom target type looks like this:
extension CustomAPI: TargetType {
var path = "/something&something"
...
and I get the path of the resulting target, it looks like "/something&something". My backend requires that ampersands are replaced with "%26". However, if I do
extension CustomAPI: TargetType {
var path = "/something%26something"
...
Moya encodes the % as %25, even though it wouldn't encode the ampersand. So in turn the path is now "%2625".
Is there anyway to choose which characters get encoded?
Using most recent version of Moya
I want to make a request to a route that has an "&" character in it. Moya by default will not encode this character, so for example if my custom target type looks like this:
and I get the
path
of the resultingtarget
, it looks like "/something&something". My backend requires that ampersands are replaced with "%26". However, if I doMoya encodes the % as %25, even though it wouldn't encode the ampersand. So in turn the path is now "%2625".
Is there anyway to choose which characters get encoded?