简体   繁体   中英

URL Format in deep linking on ios

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? ie

myapp://search%3frange%3d%7b1%2c3%7d

or just keep using

myapp://search?range={1,3}

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

如果您根本不需要json,请使用myapp://search/range/1/3https://github.com/joeldev/JLRoutes之类的东西

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM