iOS Url引數拆分
Scheme Url
-(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options{
NSLog(@"%@",url.description);
NSLog(@"%@",url.absoluteString);
NSLog(@"%@",url.relativeString);
NSLog(@"%@",url.scheme);
NSLog(@"%@",url.resourceSpecifier);
NSLog(@"%@",url.description);
NSLog(@"%@",url.host);
NSLog(@"%@",url.port);
NSLog(@"%@",url.user);
NSLog(@"%@",url.password);
NSLog(@"%@",url.path);
NSLog(@"%@",url.fragment);
NSLog(@"%@",url.parameterString);
NSLog(@"%@",url.query);
NSLog(@"%@",url.relativePath);
return YES;
}
zyurl://TargetA/Action/type?name=zhangyu
列印結果:
2017-08-22 10:50:48.420115+0800 URLParamsDemo[8874:411040] zyurl://TargetA/Action/type?name=zhangyu
2017-08-22 10:50:48.420361+0800 URLParamsDemo[8874:411040] zyurl://TargetA/Action/type?name=zhangyu
2017-08-22 10:50:48.420999+0800 URLParamsDemo[8874:411040] zyurl://TargetA/Action/type?name=zhangyu
2017-08-22 10:50:48.421141+0800 URLParamsDemo[8874:411040] zyurl
2017-08-22 10:50:48.421724+0800 URLParamsDemo[8874:411040] //TargetA/Action/type?name=zhangyu
2017-08-22 10:50:48.421894+0800 URLParamsDemo[8874:411040] zyurl://TargetA/Action/type?name=zhangyu
2017-08-22 10:50:48.422295+0800 URLParamsDemo[8874:411040] TargetA
2017-08-22 10:50:48.422519+0800 URLParamsDemo[8874:411040] (null)
2017-08-22 10:50:48.423358+0800 URLParamsDemo[8874:411040] (null)
2017-08-22 10:50:48.424640+0800 URLParamsDemo[8874:411040] (null)
2017-08-22 10:50:48.425456+0800 URLParamsDemo[8874:411040] /Action/type
2017-08-22 10:50:48.426119+0800 URLParamsDemo[8874:411040] (null)
2017-08-22 10:50:48.427117+0800 URLParamsDemo[8874:411040] (null)
2017-08-22 10:50:48.427617+0800 URLParamsDemo[8874:411040] name=zhangyu
2017-08-22 10:50:48.428053+0800 URLParamsDemo[8874:411040] /Action/type
分析有用的引數:
scheme:獲取scheme
resourceSpecifier:獲取scheme剩下的那部分
path:路徑
query:條件引數
請求url
列印結果:
2017-08-22 10:56:31.550373+0800 URLParamsDemo[9830:453299] https://passport.csdn.net/account/login?ref=toolbar
2017-08-22 10:56:31.550614+0800 URLParamsDemo[9830:453299] https://passport.csdn.net/account/login?ref=toolbar
2017-08-22 10:56:31.550723+0800 URLParamsDemo[9830:453299] https://passport.csdn.net/account/login?ref=toolbar
2017-08-22 10:56:31.550826+0800 URLParamsDemo[9830:453299] https
2017-08-22 10:56:31.551019+0800 URLParamsDemo[9830:453299] //passport.csdn.net/account/login?ref=toolbar
2017-08-22 10:56:31.551200+0800 URLParamsDemo[9830:453299] https://passport.csdn.net/account/login?ref=toolbar
2017-08-22 10:56:31.551333+0800 URLParamsDemo[9830:453299] passport.csdn.net
2017-08-22 10:56:31.551460+0800 URLParamsDemo[9830:453299] (null)
2017-08-22 10:56:31.551602+0800 URLParamsDemo[9830:453299] (null)
2017-08-22 10:56:31.551723+0800 URLParamsDemo[9830:453299] (null)
2017-08-22 10:56:31.551830+0800 URLParamsDemo[9830:453299] /account/login
2017-08-22 10:56:31.551947+0800 URLParamsDemo[9830:453299] (null)
2017-08-22 10:56:31.552124+0800 URLParamsDemo[9830:453299] (null)
2017-08-22 10:56:31.552415+0800 URLParamsDemo[9830:453299] ref=toolbar
2017-08-22 10:56:31.552619+0800 URLParamsDemo[9830:453299] /account/login
相關文章
- js解析url引數JS
- JavaScript解析URL引數JavaScript
- jQuery接收url的引數jQuery
- js獲取url引數JS
- jquery獲取url引數jQuery
- 動態路由(URL引數)路由
- js獲取url傳遞引數,js獲取url?號後面的引數JS
- python json格式轉url引數&分割, url引數轉json格式PythonJSON
- 使用jquery獲取url及url引數的方法jQuery
- 使用js修改url地址引數JS
- js去除url中指定引數JS
- 常用URL引數操作方法
- jQuery獲取url引數值jQuery
- Mysql JDBC Url引數說明MySqlJDBC
- Js獲取URL地址引數JS
- http_build_query引數拼接urlHTTPUI
- js實現獲取URL引數JS
- C#獲取URL引數值C#
- javascript如何修改url地址的引數JavaScript
- 獲得url地址?後的引數
- js根據引數名獲取url上的引數值JS
- 什麼是請求引數、表單引數、url引數、header引數、Cookie引數?一文講懂HeaderCookie
- js如何獲取url所傳遞的引數和引數值JS
- JavaScript 獲取 url 傳遞引數值JavaScript
- C# 解析獲取Url引數值C#
- nginx url必須攜帶引數判定Nginx
- Go 1.22中路由 URL 路由引數Go路由
- url傳遞的引數值編碼
- 獲取url傳遞的引數值
- 【轉】AngularJs $location獲取url引數AngularJS
- js獲取url地址中的引數JS
- as3獲取url地址的引數S3
- 線上json轉url引數格式工具JSON
- iOS可變引數(不定引數)的用法iOS
- 用javascript替換URL中的引數值JavaScript
- react獲取當前頁面的url引數React
- Django裡URL配置中name引數的作用Django
- React中的url引數——this.props.matchReact