在Swift中将String转换为JSON String [英] Convert String to JSON String in Swift
本文介绍了在Swift中将String转换为JSON String的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何转换格式如下的字符串:
How can I convert string with format like:
{Param1: "Value", Param2: "value2", Param3: "value3"}
到我的Post查询的JSON字符串? 预先感谢.
to JSON string for my Post query? Thanks in advance.
推荐答案
这已经是一个JSON字符串,只需将其发送并附加标头即可.
This is already a JSON string just send it appended with the headers.
如果您需要访问这些值,则需要使用诸如swiftyJSON或JSONswift之类的东西.
If you need to access these values, then you need to use something like swiftyJSON or JSONswift.
这篇关于在Swift中将String转换为JSON String的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文