【问题标题】:How to configure camel casing serializing settings globally in Flurl Http?如何在 Flurl Http 中全局配置驼峰序列化设置?
【发布时间】:2022-10-31 03:50:23
【问题描述】:

我想在 Flurl 中使用 PostAsync 时有一个骆驼案例序列化 json

【问题讨论】:

    标签: .net-core flurl


    【解决方案1】:
    FlurlHttp.Configure(settings =>
    {
        var jsonSettings = new JsonSerializerSettings
        {
            NullValueHandling = NullValueHandling.Ignore,
            ObjectCreationHandling = ObjectCreationHandling.Replace,
            ContractResolver = new CamelCasePropertyNamesContractResolver()
        };
        settings.JsonSerializer = new NewtonsoftJsonSerializer(jsonSettings);
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-02-25
      • 2021-11-22
      • 1970-01-01
      • 2019-02-05
      • 1970-01-01
      • 2017-09-15
      • 1970-01-01
      相关资源
      最近更新 更多