[英]Does flurl support graphQL requests?
Is it possible to use flurl to send a post request to a GraphQL API?是否可以使用 flurl 向 GraphQL API 发送发布请求?
I've tried the following, but I'm only getting errors back.我已经尝试了以下方法,但我只会收到错误消息。
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);
}
The API provider did something, and now the requests are accepted API 提供者做了一些事情,现在请求被接受了
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.