swift3.0 data转String 打印输出

swift3.0 data转String 打印输出,第1张

概述/* 打印json数据 */ LJDownLoadNetImage.request("GET", url: "http://jsonplaceholder.typicode.com/users/1") { (data, respond, error) in data转String let str =


 /*         打印Json数据         */        LJDownLoadNetimage.request("GET",url: "http://Jsonplaceholder.typicode.com/users/1") { (data,respond,error) in            data转String            let str = String(data:data!,enCoding: String.EnCoding.utf8)!            print(str)        }

打印结果
{  "ID": 1,"name": "Leanne Graham","username": "Bret","email": "Sincere@april.biz","address": {    "street": "Kulas light","suite": "Apt. 556","city": "Gwenborough","zipcode": "92998-3874","geo": {      "lat": "-37.3159","lng": "81.1496"    }  },"phone": "1-770-736-8031 x56442","website": "hildegard.org","company": {    "name": "Romaguera-Crona","catchPhrase": "multi-layered clIEnt-server neural-net","bs": "harness real-time e-markets"  }}
总结

以上是内存溢出为你收集整理的swift3.0 data转String 打印输出全部内容,希望文章能够帮你解决swift3.0 data转String 打印输出所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1061448.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-25
下一篇 2022-05-25

发表评论

登录后才能评论

评论列表(0条)

保存