我们如何通过GraphQl中的空格传递标题参数?

发布于 2025-02-12 10:10:54 字数 534 浏览 0 评论 0原文

API在GraphQL操场上工作绝对很好。

但是,当我在Postman中使用相同数据测试相同的API时,它给了我一个错误。

{
    "errors": [
        {
            "message": "Context creation failed: Permission denied",
            "statusCode": 500
        }
    ]
}

我正在将访问令牌传递到标题中

{"authorization":"Bearer accesstoken"}

以这种格式进行邮递员的数据

authorization: Bearer accesstoken

,问题是在携带者中的空白处,并且访问令牌

有什么办法可以通过标头中的whitespaces传递一个值?

我尝试使用%20_

API is working absolutely fine in graphql playground.

But when I tested the same API with the same data in postman it gave me an error.

{
    "errors": [
        {
            "message": "Context creation failed: Permission denied",
            "statusCode": 500
        }
    ]
}

I was passing the access token in the header

like:

{"authorization":"Bearer accesstoken"}

In terms of postman data is going in this format

authorization: Bearer accesstoken

The issue is with the white space in the Bearer and access token

Is there any way we can pass a value with whitespaces in header?

I have tried using %20 and _.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文