Convert string to JSON string in Swift

How to convert a string to a format, for example:

{Param1: "Value", Param2: "value2", Param3: "value3"} 

to a JSON string for my mail request? Thanks in advance.

0
json string swift
source share
2 answers

This is already a JSON string, just sending it with headers.

If you need to access these values, you need to use something like swiftyJSON or JSONswift.

0
source share

What you posted looks like a be a JSON string containing a dictionary.

0
source share

All Articles