【发布时间】: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做了一些事情,但我不知道是什么。请求今天被接受:)