Adding or Modifying Response Headers
Function
This API is used to add or modify response headers.
URI
PUT /v1.0/cdn/domains/{domain_id}/response-header
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
domain_id |
Yes |
String |
Specifies the acceleration domain name ID. For details, see Querying Details About a Domain Name. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
enterprise_project_id |
No |
String |
Enterprise project that the domain name to be modified belongs to. This parameter is valid only when the enterprise project function is enabled. The value all indicates all projects. This parameter is mandatory when you use an IAM user to call this API. Obtain the enterprise project ID by calling the ListEnterpriseProject API of Enterprise Project Management Service (EPS). |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
Specifies the user token. The token can be obtained by calling the IAM API used to obtain a user token. The value of **X-Subject-Token** in the response header is the user token. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
headers |
No |
HeaderMap object |
Specifies the values of HTTP headers. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
Content-Disposition |
No |
String |
Specifies the format in which the response content is displayed. |
Content-Language |
No |
String |
Specifies the languages that the visitor wants to use. |
Access-Control-Allow-Origin |
No |
String |
Specifies whether cross-origin resource sharing (CORS) is enabled for the response content. |
Access-Control-Allow-Methods |
No |
String |
Specifies the methods that can be used by the content to be accessed by the client. |
Access-Control-Max-Age |
No |
String |
Specifies how long the information provided by the Access-Control-Allow-Methods and Access-Control-Allow-Headers can be cached. |
Access-Control-Expose-Headers |
No |
String |
Specifies the headers that can be exposed as a part of responses to requests from other clients. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
headers |
HeaderMap object |
Specifies the HTTP header value. |
Parameter |
Type |
Description |
---|---|---|
Content-Disposition |
String |
Specifies the format in which the response content is displayed. |
Content-Language |
String |
Specifies the languages that the visitor wants to use. |
Access-Control-Allow-Origin |
String |
Specifies whether cross-origin resource sharing (CORS) is enabled for the response content. |
Access-Control-Allow-Methods |
String |
Specifies the methods that can be used by the content to be accessed by the client. |
Access-Control-Max-Age |
String |
Specifies how long the information provided by the Access-Control-Allow-Methods and Access-Control-Allow-Headers can be cached. |
Access-Control-Expose-Headers |
String |
Specifies the headers that can be exposed as a part of responses to requests from other clients. |
Example Requests
PUT https://cdn.myhuaweicloud.com/v1.0/cdn/domains/ff808***********************307d/response-header { "headers" : { "Content-Disposition" : "test.xml", "Content-Language" : "en-US", "Access-Control-Max-Age" : "86400" } }
Example Responses
Status code: 200
OK
{ "headers" : { "Content-Disposition" : "test.xml", "Content-Language" : "en-US", "Access-Control-Max-Age" : "86400" } }
Status Codes
Status Code |
Description |
---|---|
200 |
OK |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot