class JsonContent
cangjie
public class JsonContent <: ByteArrayContent功能:表示 JSON 格式的 HTTP 内容。
父类型:
成员概览
| 成员 | 功能 |
|---|---|
| func create(T) | 使用可序列化对象创建 JSON 内容。 |
| func create(T, JsonSerializerOptions) | 使用指定序列化选项创建 JSON 内容。 |
| func create(String) | 使用现成 JSON 字符串创建内容对象。 |
func create(T)
cangjie
public static func create<T>(data: T): JsonContent where T <: ISerialization<T>功能:使用可序列化对象创建 JSON 内容。
参数:
- data:
T- 要序列化的对象。
返回值:
- JsonContent - 创建出的 JSON 内容对象。
func create(T, JsonSerializerOptions)
cangjie
public static func create<T>(data: T, options: JsonSerializerOptions): JsonContent where T <: ISerialization<T>功能:使用指定序列化选项创建 JSON 内容。
参数:
- data:
T- 要序列化的对象。 - options: JsonSerializerOptions - JSON 序列化选项。
返回值:
- JsonContent - 创建出的 JSON 内容对象。
func create(String)
cangjie
public static func create(json: String): JsonContent功能:使用现成 JSON 字符串创建内容对象。
参数:
- json:
String- JSON 字符串。
返回值:
- JsonContent - 创建出的 JSON 内容对象。