gpt4 book ai didi

javascript - 如何在 JavaScript 中获取所有 Apigee 请求 header ?

转载 作者:行者123 更新时间:2023-12-05 05:27:00 24 4
gpt4 key购买 nike

我有一些 JavaScript,我需要在其中处理 Apigee 中的所有请求 header 。在线文档 ( http://apigee.com/docs/api-services/content/javascript-object-model ) 提到它们可以通过 context.proxyRequest.headers 作为名称/值对使用。我是否必须遍历它们,或者它们是否可以通过 context.proxyRequest.headers 作为数组一起使用?

谢谢。

最佳答案

您可以使用如下所示的方式通过 javascript 访问请求 header

var request_headers = context.getVariable("request.headers.names");

此变量的范围仅在代理请求流内。

关于javascript - 如何在 JavaScript 中获取所有 Apigee 请求 header ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22622151/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com