flurl升级之后没有FlurlNewtonsoftJsonSerializer

新建NewtonsoftJsonSerializer.cs

cs 复制代码
/// <summary>
/// ISerializer implementation based on Newtonsoft.Json.
/// Default serializer used in calls to GetJsonAsync, PostJsonAsync, etc.
/// </summary>
public class NewtonsoftJsonSerializer : IJsonSerializer
{
    private readonly JsonSerializerSettings _settings;

    /// <summary>
    /// Initializes a new instance of the <see cref="NewtonsoftJsonSerializer"/> class.
    /// </summary>
    /// <param name="settings">Settings to control (de)serialization behavior.</param>
    public NewtonsoftJsonSerializer(JsonSerializerSettings settings = null) {
        _settings = settings;
    }
    
    public string Serialize(object obj, Type type)
    {
        return JsonConvert.SerializeObject(obj, _settings);
    }

    public object Deserialize(string json, Type type)
    {
        return JsonConvert.DeserializeObject(json,type, _settings);
    }
}

代码修改为下面的即可

相关推荐
言乐65 小时前
Python游戏水平测试辅助系统
开发语言·python·游戏·django·pygame
yuhulkjv33510 小时前
Claude表格复制到word不再崩溃,AI导出鸭批量导出+格式无损一键搞定
人工智能·ai·c#·word·ai导出鸭
WWJA王文举12 小时前
I²C通信完整流程详解:START、地址、ACK、数据、Repeated START和STOP一次讲透
c语言·开发语言
zhanghaha131413 小时前
Python进阶教程:6_JSON 数据解析 —— 新手完全指南
开发语言·python·json
qq_4480111614 小时前
C语言中的动态内存分配
c语言·开发语言·php
汉字萌萌哒14 小时前
2024CSP-J入门级C++真题详解
开发语言·c++
arbboter15 小时前
【网络工具】NetProxy网络代理用户手册
开发语言·网络·c#·网络代理·网络异常·代理工具
微小冷15 小时前
海康威视相机C#二次开发环境配置
数码相机·c#·.net·海康威视·相机开发
汉字萌萌哒16 小时前
2019CCF-CSP入门级C++试题解析
java·开发语言·c++
叠层归一研究院16 小时前
AGI 系统(十一):二阶网络 — 二阶递归 × 多主体 (元符号网络)
开发语言·人工智能·算法·php·agi