All Products
Search
Document Center

Object Storage Service:WriteGetObjectResponse

Last Updated:Jun 08, 2026

Customizes the response data and headers for a GetObject request processed through Function Compute.

Prerequisites

Grant the oss:WriteGetObjectResponse permission to the default role (AliyunFCDefaultRole) of your Function Compute service. Sample policy:

{
  "Statement": [
    {
      "Action": "oss:WriteGetObjectResponse",
      "Effect": "Allow",
      "Resource": "*"
    }
  ],
  "Version": "1"
}

Grant permissions to a RAM role.

Request headers

POST /?x-oss-write-get-object-response HTTP/1.1
Host: RouteFromFcEvent
Date: GMT Date
Authorization: SignatureValue
x-oss-request-route: RouteFromFcEvent
x-oss-request-token: TokenFromFcEvent
x-oss-fwd-status: StatusCode
x-oss-fwd-header-Accept-Ranges: AcceptRanges
x-oss-fwd-header-Cache-Control: CacheControl
x-oss-fwd-header-Content-Disposition: ContentDisposition
x-oss-fwd-header-Content-Encoding: ContentEncoding
x-oss-fwd-header-Content-Language: ContentLanguage
Content-Length: ContentLength
x-oss-fwd-header-Content-Range: ContentRange
x-oss-fwd-header-Content-Type: ContentType
x-oss-fwd-header-ETag: ETag
x-oss-fwd-header-Expires: Expires
x-oss-fwd-header-Last-Modified: LastModified

Request header parameters

Header

Type

Required

Example

Description

Host

String

Yes

****-opap.oss-cn-qingdao-internal.oss-object-process.aliyuncs.com

Route address from the Function Compute event parameter.

Date

String

Yes

Tue, 31 Oct 2023 03:17:58 GMT

Request initiation time in HTTP 1.1 GMT format.

Authorization

String

Yes

OSS lkojgn8y1exic6e:6****+BuuEqzI1tAMW0wgIyl****

Authenticates the request. Calculate this value as described in Include signatures in the Authorization header.

x-oss-request-route

String

Yes

****-opap.oss-cn-qingdao-internal.oss-object-process.aliyuncs.com

Route address from the Function Compute event parameter.

x-oss-request-token

String

Yes

OSSV1#ZvBDC3XPm3g****

Forwarding token from the Function Compute event parameter.

x-oss-fwd-status

String

Yes

200

HTTP status code from the backend server.

Valid values: 200, 206, 301, 302, 303, 304, 400, 401, 403, 404, 405, 409, 411, 412, 416, 500, and 503.

x-oss-fwd-header-Accept-Ranges

String

No

bytes

Specifies the queryable resource range.

x-oss-fwd-header-Cache-Control

String

No

no-cache

Specifies client caching behavior. Valid values:

  • no-cache: Forces revalidation with the server on each access.

  • no-store: Disables caching entirely.

  • public: Allows caching by any cache.

  • private: Allows caching on the client only.

  • max-age=<seconds>: Cache validity period in seconds. HTTP 1.1 only.

x-oss-fwd-header-Content-Disposition

String

No

attachment

Controls download behavior. Valid values:

  • Content-Disposition:inline: Previews the object in the browser.

  • Content-Disposition:attachment: Downloads with the original object name.

  • Content-Disposition:attachment; filename="yourFileName": Downloads with a custom name.

    yourFileName is the custom filename, such as example.jpg.

x-oss-fwd-header-Content-Encoding

String

No

gzip

Specifies the content encoding. Valid values:

  • identity (default): No encoding applied.

  • gzip: LZ77 compression with 32-bit CRC.

  • compress: LZW compression.

  • deflate: zlib structure with deflate compression.

  • br: Brotli compression.

x-oss-fwd-header-Content-Language

String

No

en

Specifies the content language.

Content-Length

String

Yes

67589

Size of the HTTP message body in bytes.

x-oss-fwd-header-Content-Range

String

No

bytes 0-9/67589

Specifies the byte range of the returned content. For example, bytes 0-9/67589 returns the first 10 bytes of a 67,589-byte object.

x-oss-fwd-header-Content-Type

String

No

text/html; charset=utf-8

Specifies the MIME type of the response body.

x-oss-fwd-header-ETag

String

No

D41D8CD98F00B204E9800998ECF8****

Entity tag that uniquely identifies the object.

x-oss-fwd-header-Expires

String

No

Fri, 10 Nov 2023 03:17:58 GMT

Absolute expiration time of the cached content.

x-oss-fwd-header-Last-Modified

String

No

Tue, 10 Oct 2023 03:17:58 GMT

Last modification time of the requested resource.

Response headers

WriteGetObjectResponse returns only Common HTTP headers.

Examples

  • Sample request

    POST /?x-oss-write-get-object-response HTTP/1.1
    Host: RouteFromFcEvent
    Date: Tue, 31 Oct 2023 03:17:58 GMT
    Authorization: SignatureValue
    x-oss-request-route: RouteFromFcEvent
    x-oss-request-token: TokenFromFcEvent
    x-oss-fwd-status: 200
    x-oss-fwd-header-Accept-Ranges: bytes
    x-oss-fwd-header-Cache-Control: no-cache
    x-oss-fwd-header-Content-Disposition: attachment
    x-oss-fwd-header-Content-Encoding: gzip
    x-oss-fwd-header-Content-Language: en
    Content-Length: 67589
    x-oss-fwd-header-Content-Range: bytes 0-9/67589
    x-oss-fwd-header-Content-Type: text/html; charset=utf-8
    x-oss-fwd-header-ETag: D41D8CD98F00B204E9800998ECF8****
    x-oss-fwd-header-Expires: Fri, 10 Nov 2023 03:17:58 GMT
    x-oss-fwd-header-Last-Modified: Tue, 10 Oct 2023 03:17:58 GMT
  • Sample response

    HTTP/1.1 200 OK
    x-oss-request-id: 6540CF0DCB24453133A****
    Date: Tue, 31 Oct 2023 03:17:58 GMT
    Content-Length: 0