【问题标题】:Ask - How to use the word 'params' in 'PostJsonAsync' Flurl问 - 如何在“PostJsonAsync”Flurl 中使用“参数”这个词
【发布时间】:2020-07-23 12:20:57
【问题描述】:

我正在使用 flurl 来检索 url 中的数据。如何在PostJsonAsync中使用params这个词?我遇到的问题是identifier expected: 'params' is keyword,如果我使用“params”以外的其他词就没有问题。

            .PostJsonAsync(new
            {
                variables = (new
                {
                    params = "&ob=23&identifier=handphone-tablet_aksesoris-handphone&sc=66&user_id=0&rows=60&start=1&source=directory&device=desktop&page=1&related=true&st=product&safe_search=false"
                }),
            })

【问题讨论】:

  • @Hulk 我认为这只是一个错误的标签,对不起

标签: c# json post flurl


【解决方案1】:

任何时候您想使用 C# 保留字作为属性名称,只需在其前面加上 @

new 
{
    @params = "..."
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多