【问题标题】:Does flurl support graphQL requests?flurl 是否支持 graphQL 请求?
【发布时间】:2019-10-08 07:38:56
【问题描述】:

是否可以使用 flurl 向 GraphQL API 发送 post 请求?

我尝试了以下方法,但我只得到错误。

var stringContent = @"query {
                webhooks {
                    data {
                        id
                        name
                        topic
                        source
                        address
                        enabled
                        hashKey
                    }
                }
            }";

HttpContent content = new StringContent(stringContent, Encoding.UTF8, "application/graphql");

try
        {
            var test = await GRAPHQL_API_URL
                .WithOAuthBearerToken(ACCESS_TOKEN)
                .WithHeader("Content-Type", "application/graphql")
                .PostAsync(content).ReceiveJson();
        }
        catch(Exception ex)
        {
            Console.WriteLine(ex.Message);
        }

【问题讨论】:

  • 你遇到了什么错误?
  • 显然API提供者对API做了一些事情,但我不知道是什么。请求今天被接受:)

标签: c# graphql flurl


【解决方案1】:

API 提供者做了一些事情,现在请求被接受了

【讨论】:

    猜你喜欢
    • 2020-08-06
    • 2023-04-04
    • 1970-01-01
    • 2019-05-17
    • 2022-01-15
    • 1970-01-01
    • 2022-08-03
    • 1970-01-01
    • 2019-06-17
    相关资源
    最近更新 更多