是否可以使用 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);
}