x-amazon-apigateway-gateway-回應。 responseParameters 物件 - Amazon API 网关

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

x-amazon-apigateway-gateway-回應。 responseParameters 物件

定義索引鍵值配對的對 string-to-string 映,以從傳入的要求參數或使用常值字串產生閘道回應參數。僅支援 RESTAPIs.

屬性名稱 類型 描述
gatewayresponse.param-position.param-name string

param-position 可以是 headerpathquerystring。如需詳細資訊,請參閱將方法請求資料對應到整合請求參數

x-amazon-apigateway-gateway-回應。 responseParameters 例子

下列 Open API 擴充功能範例顯示GatewayResponse回應參數對應運算式,以啟用對*.example.domain網域資源的CORS支援。

"responseParameters": { "gatewayresponse.header.Access-Control-Allow-Origin": '*.example.domain', "gatewayresponse.header.from-request-header" : method.request.header.Accept, "gatewayresponse.header.from-request-path" : method.request.path.petId, "gatewayresponse.header.from-request-query" : method.request.querystring.qname }