هذه الصفحة غير متوفرة حاليًا بلغتك المحلية. نحن نعمل جاهدين على إضافة المزيد من اللغات. شاكرين تفهمك ودعمك المستمر لنا.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Configuring HTTP Response Header Management

Updated on 2024-11-27 GMT+08:00

ROMA Connect provides flexible extension capabilities for APIs through plug-in policies. An HTTP response header management policy enables you to customize HTTP response headers that will be returned in an API response.

Plug-in policies and APIs are independent of each other. A plug-in policy takes effect for an API only after it is bound to the API. When binding a plug-in policy to an API, you must specify an environment where the API has been published. The plug-in policy takes effect for the API only in the specified environment.

Constraints

  • An API can be bound to only one plug-in policy of the same type in the same environment. A plug-in policy that has been bound to an API cannot be deleted.
  • The system response headers (such as x-apig-* and x-request-id) cannot be modified.
  • The response headers for CORS cannot be modified.

Creating an HTTP Response Header Management Policy

  1. Log in to the ROMA Connect console. On the Instances page, click View Console next to a specific instance.
  2. In the navigation pane on the left, choose API Connect > API Policies. On the Policies tab, click Create Policy.
  3. On the Select Policy Type page, select HTTP Response Header Management in the Plug-ins area.
  4. On the page displayed, configure plug-in policy information.
    Table 1 Policy configuration

    Parameter

    Description

    Name

    Enter a policy name. Using naming rules facilitates future search.

    Type

    Fixed as HTTP Response Header Management.

    Scope

    Specify the scope to view the policy.

    • Integration application: Each policy belongs to an integration application. Only users who have the permission on the integration application can view and use the policy.
    • All: All users in the current instance can view and use the policy.

    Integration Application

    Mandatory for Scope set to Integration application.

    Select an integration application for the policy. If none is available, click Create Integration Application on the right to create one.

    Description

    Describe the policy.

    Policy Content: Configure the policy in a form or script. For details about how to configure a script, see Script Configuration Example.

    Response Headers

    Click Add Response Header to add a response header.

    NOTE:

    For security purposes, do not include sensitive information in these parameters.

    • Name: name of the response header, which is case-insensitive and must be unique within a plug-in.
    • Value: value of the response header. This parameter does not take effect and is left blank if you set Action to Delete.
    • Action: operation of the response header. You can override, append, delete, skip, or add the specified header.
      • Override

        - The value of this response header will override that of the same header that exists in an API response.

        If an API response contains multiple headers with the same name as the one you set here, only the value of the specified header will be returned.

        - If an API response does not contain the specified header, the value you set here will be returned.

      • Append

        - If an API response contains the specified header, the value you set here will be added, following the existing value. The two values will be separated with commas (,).

        - If an API response contains multiple headers with the same name as the one you set here, values of these headers will be separated with commas (,) and followed by the value of the specified header.

        - If an API response does not contain the specified header, the value you set here will be returned.

      • Delete

        - If an API response contains the specified header, the header will be deleted.

        - If an API response contains multiple headers with the same name as the one you set here, all these headers will be deleted.

      • Skip

        - If an API response contains the specified header, the header will be skipped.

        - If an API response contains multiple headers with the same name as the one you set here, values of all these headers will be returned without modification.

        - If an API response does not contain the specified header, the value you set here will be returned.

      • Add

        The value of the specified header will be returned even if the header does not exist in an API response.

  5. Click OK.

    After a plug-in policy is created, perform Binding a Plug-in Policy to an API for the policy to take effect for the API.

Binding a Plug-in Policy to an API

  1. On the Policies tab, filter policies by HTTP Response Header Management.
  2. Click the name of a policy to go to the details page.
  3. On the APIs tab, select the environment of the APIs you want to bind the policy to and click Bind to APIs.
  4. On the page displayed, select the APIs to bind the policy to.

    APIs can be filtered by API group and API name.

  5. Click OK.

Script Configuration Example

{
  "response_headers": [
    {
      "name": "header1",
      "value": "test",
      "action": "append"
    },
    {
      "name": "header2",
      "value": "roma",
      "action": "override"
    }
  ]
}

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback