Reputation: 110570
I am working on adding deep linking for my ios app.
My url format is "myapp://search?range={1,3}"
My question is should I support the format which is url encoded? i.e.
myapp://search%3frange%3d%7b1%2c3%7d
or just keep using
myapp://search?range={1,3}
Upvotes: 0
Views: 2802
Reputation: 4406
If you dont need json at all, use something like myapp://search/range/1/3
and https://github.com/joeldev/JLRoutes.
Upvotes: 1
Reputation: 318804
The ?
mark is a proper symbol to start a query string. Do not encode it.
The =
sign is being used to separate a URL query parameter from its value. Do not encode it.
The numbers are perfectly safe unreserved URI characters and do not need to be encoded.
The comma should be encoded since it is a reserved character.
The curly braces, technically, should be encoded since they are not listed as reserved or unreserved characters in RFC 3986.
See the percent-encoding article on Wikipedia for more details.
So you probably want:
myapp://search?range=%7b1%2c3%7d
Upvotes: 2