Setting Custom Headers

Last updated: 2023-09-13 15:08:45

Feature Overview

This document describes how to include custom headers in a request using the SDK.

SDK API References

For detailed parameters and method descriptions of all SDK interfaces, please refer to SDK API.

Note

COS allows object upload requests to include custom headers that specify user-defined metadata. These headers start with x-cos-meta-, end with a custom suffix, and are saved as part of the object metadata.
If you have activated the Tencent Cloud CI service, you can specify the Pic-Operations header to enable automatic image processing. For detailed API instructions, see Persistence Processing.

Sample code

Objective-C
request.customHeaders[@"custom-key"] = @"custom-value";
Note
For the complete sample, go to GitHub.
Swift
request.customHeaders["custom-key"] = "custom-value";
Note
For the complete sample, go to GitHub.