tencent cloud

masukan

Setting Custom Headers

Terakhir diperbarui:2024-02-02 14:36:36

    Overview

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

    Description

    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

    PutObjectRequest request = new PutObjectRequest(bucket, key, srcPath);
    
    request.SetRequestHeader("x-cos-meta-key", "value");
    request.SetRequestHeader("Content-Disposition", "attachment");
    
    COSXMLUploadTask uploadTask = new COSXMLUploadTask(request);
    uploadTask.SetSrcPath(srcPath);
    Note:
    For the complete sample, go to GitHub.
    Hubungi Kami

    Hubungi tim penjualan atau penasihat bisnis kami untuk membantu bisnis Anda.

    Dukungan Teknis

    Buka tiket jika Anda mencari bantuan lebih lanjut. Tiket kami tersedia 7x24.

    Dukungan Telepon 7x24