ios - Prevent escaping brackets in URLs -


our image server allows pass url parameters trigger image manipulation operations. instance url https://www.example.com/i/example/10570250?layer0=[w=600&h=1000&bg=rgba(228,228,228,125)&cm=multi] scales image , applies blending mode.

the problem feed string url object, example url(string: "https://www.example.com/i/example/10570250?layer0=[w=600&h=1000&bg=rgba(228,228,228,125)&cm=multi]") brackets escaped , image server stops applying operations.

the url becomes: https://www.example.com/i/example/10570250?layer0=%5bw=600&h=1000&bg=rgba(228,228,228,125)&cm=multi%5d

can prevent url escaping brackets? or ist there other way of escaping url, before feeding url(string:), image server might accept?

you´re not allowed include [ ] in url. consider changing api call make work you.

a host identified internet protocol literal address, version 6
[rfc3513] or later, distinguished enclosing ip literal
within square brackets ("[" , "]"). place where
square bracket characters allowed in uri syntax. in
anticipation of future, as-yet-undefined ip literal address formats,
implementation may use optional version flag indicate such format explicitly rather rely on heuristic determination.

reference.


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -