Show / Hide Table of Contents

Class PutObjectRequest

Inheritance
object
PutObjectRequest
Implements
IOciRequest
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Oci.ObjectstorageService.Requests
Assembly: OCI.DotNetSDK.Objectstorage.dll
Syntax
public class PutObjectRequest : IOciRequest
Examples

Click here to see an example of how to use PutObject request.

Properties

BucketName

Declaration
[Required(ErrorMessage = "BucketName is required.")]
[HttpConverter(TargetEnum.Path, "bucketName")]
public string BucketName { get; set; }
Property Value
Type Description
string

The name of the bucket. Avoid entering confidential information. Example: my-new-bucket1

Remarks

Required

CacheControl

Declaration
[HttpConverter(TargetEnum.Header, "Cache-Control")]
public string CacheControl { get; set; }
Property Value
Type Description
string

The optional Cache-Control header that defines the caching behavior value to be returned in GetObject and HeadObject responses. Specifying values for this header has no effect on Object Storage behavior. Programs that read the object determine what to do based on the value provided. For example, you could use this header to identify objects that require caching restrictions.

ContentDisposition

Declaration
[HttpConverter(TargetEnum.Header, "Content-Disposition")]
public string ContentDisposition { get; set; }
Property Value
Type Description
string

The optional Content-Disposition header that defines presentational information for the object to be returned in GetObject and HeadObject responses. Specifying values for this header has no effect on Object Storage behavior. Programs that read the object determine what to do based on the value provided. For example, you could use this header to let users download objects with custom filenames in a browser.

ContentEncoding

Declaration
[HttpConverter(TargetEnum.Header, "Content-Encoding")]
public string ContentEncoding { get; set; }
Property Value
Type Description
string

The optional Content-Encoding header that defines the content encodings that were applied to the object to upload. Specifying values for this header has no effect on Object Storage behavior. Programs that read the object determine what to do based on the value provided. For example, you could use this header to determine what decoding mechanisms need to be applied to obtain the media-type specified by the Content-Type header of the object.

ContentLanguage

Declaration
[HttpConverter(TargetEnum.Header, "Content-Language")]
public string ContentLanguage { get; set; }
Property Value
Type Description
string

The optional Content-Language header that defines the content language of the object to upload. Specifying values for this header has no effect on Object Storage behavior. Programs that read the object determine what to do based on the value provided. For example, you could use this header to identify and differentiate objects based on a particular language.

ContentLength

Declaration
[HttpConverter(TargetEnum.Header, "Content-Length")]
public long? ContentLength { get; set; }
Property Value
Type Description
long?

The content length of the body.

ContentMD5

Declaration
[HttpConverter(TargetEnum.Header, "Content-MD5")]
public string ContentMD5 { get; set; }
Property Value
Type Description
string

The optional header that defines the base64-encoded MD5 hash of the body. If the optional Content-MD5 header is present, Object Storage performs an integrity check on the body of the HTTP request by computing the MD5 hash for the body and comparing it to the MD5 hash supplied in the header. If the two hashes do not match, the object is rejected and an HTTP-400 Unmatched Content MD5 error is returned with the message:
"The computed MD5 of the request body (ACTUAL_MD5) does not match the Content-MD5 header (HEADER_MD5)"

ContentType

Declaration
[HttpConverter(TargetEnum.Header, "Content-Type")]
public string ContentType { get; set; }
Property Value
Type Description
string

The optional Content-Type header that defines the standard MIME type format of the object. Content type defaults to 'application/octet-stream' if not specified in the PutObject call. Specifying values for this header has no effect on Object Storage behavior. Programs that read the object determine what to do based on the value provided. For example, you could use this header to identify and perform special operations on text only objects.

Expect

Declaration
[HttpConverter(TargetEnum.Header, "Expect")]
public string Expect { get; set; }
Property Value
Type Description
string

A value of 100-continue requests preliminary verification of the request method, path, and headers before the request body is sent. If no error results from such verification, the server will send a 100 (Continue) interim response to indicate readiness for the request body. The only allowed value for this parameter is "100-Continue" (case-insensitive).

IfMatch

Declaration
[HttpConverter(TargetEnum.Header, "if-match")]
public string IfMatch { get; set; }
Property Value
Type Description
string

The entity tag (ETag) to match with the ETag of an existing resource. If the specified ETag matches the ETag of the existing resource, GET and HEAD requests will return the resource and PUT and POST requests will upload the resource.

IfNoneMatch

Declaration
[HttpConverter(TargetEnum.Header, "if-none-match")]
public string IfNoneMatch { get; set; }
Property Value
Type Description
string

The entity tag (ETag) to avoid matching. The only valid value is '*', which indicates that the request should fail if the resource already exists.

NamespaceName

Declaration
[Required(ErrorMessage = "NamespaceName is required.")]
[HttpConverter(TargetEnum.Path, "namespaceName")]
public string NamespaceName { get; set; }
Property Value
Type Description
string

The Object Storage namespace used for the request.

Remarks

Required

ObjectName

Declaration
[Required(ErrorMessage = "ObjectName is required.")]
[HttpConverter(TargetEnum.Path, "objectName")]
public string ObjectName { get; set; }
Property Value
Type Description
string

The name of the object. Avoid entering confidential information. Example: test/object1.log

Remarks

Required

OpcChecksumAlgorithm

Declaration
[HttpConverter(TargetEnum.Header, "opc-checksum-algorithm")]
public ChecksumAlgorithm? OpcChecksumAlgorithm { get; set; }
Property Value
Type Description
ChecksumAlgorithm?

The optional checksum algorithm to use to compute and store the checksum of the body of the HTTP request (or the parts in case of multipart uploads), in addition to the default MD5 checksum.

OpcClientRequestId

Declaration
[HttpConverter(TargetEnum.Header, "opc-client-request-id")]
public string OpcClientRequestId { get; set; }
Property Value
Type Description
string

The client request ID for tracing.

OpcContentCrc32c

Declaration
[HttpConverter(TargetEnum.Header, "opc-content-crc32c")]
public string OpcContentCrc32c { get; set; }
Property Value
Type Description
string

Applicable only if CRC32C is specified in the opc-checksum-algorithm request header.
The optional header that defines the base64-encoded, 32-bit CRC32C (Castagnoli) checksum of the body. If the optional opc-content-crc32c header is present, Object Storage performs an integrity check on the body of the HTTP request by computing the CRC32C checksum for the body and comparing it to the CRC32C checksum supplied in the header. If the two checksums do not match, the object is rejected and an HTTP-400 Unmatched Content CRC32C error is returned with the message:
"The computed CRC32C of the request body (ACTUAL_CRC32C) does not match the opc-content-crc32c header (HEADER_CRC32C)"

OpcContentSha256

Declaration
[HttpConverter(TargetEnum.Header, "opc-content-sha256")]
public string OpcContentSha256 { get; set; }
Property Value
Type Description
string

Applicable only if SHA256 is specified in the opc-checksum-algorithm request header.
The optional header that defines the base64-encoded SHA256 hash of the body. If the optional opc-content-sha256 header is present, Object Storage performs an integrity check on the body of the HTTP request by computing the SHA256 hash for the body and comparing it to the SHA256 hash supplied in the header. If the two hashes do not match, the object is rejected and an HTTP-400 Unmatched Content SHA256 error is returned with the message:
"The computed SHA256 of the request body (ACTUAL_SHA256) does not match the opc-content-sha256 header (HEADER_SHA256)"

OpcContentSha384

Declaration
[HttpConverter(TargetEnum.Header, "opc-content-sha384")]
public string OpcContentSha384 { get; set; }
Property Value
Type Description
string

Applicable only if SHA384 is specified in the opc-checksum-algorithm request header.
The optional header that defines the base64-encoded SHA384 hash of the body. If the optional opc-content-sha384 header is present, Object Storage performs an integrity check on the body of the HTTP request by computing the SHA384 hash for the body and comparing it to the SHA384 hash supplied in the header. If the two hashes do not match, the object is rejected and an HTTP-400 Unmatched Content SHA384 error is returned with the message:
"The computed SHA384 of the request body (ACTUAL_SHA384) does not match the opc-content-sha384 header (HEADER_SHA384)"

OpcMeta

Declaration
[HttpConverter(TargetEnum.Header, "opc-meta-")]
public Dictionary<string, string> OpcMeta { get; set; }
Property Value
Type Description
Dictionary<string, string>

Optional user-defined metadata key and value.

OpcSseCustomerAlgorithm

Declaration
[HttpConverter(TargetEnum.Header, "opc-sse-customer-algorithm")]
public string OpcSseCustomerAlgorithm { get; set; }
Property Value
Type Description
string

The optional header that specifies "AES256" as the encryption algorithm. For more information, see Using Your Own Keys for Server-Side Encryption.

OpcSseCustomerKey

Declaration
[HttpConverter(TargetEnum.Header, "opc-sse-customer-key")]
public string OpcSseCustomerKey { get; set; }
Property Value
Type Description
string

The optional header that specifies the base64-encoded 256-bit encryption key to use to encrypt or decrypt the data. For more information, see Using Your Own Keys for Server-Side Encryption.

OpcSseCustomerKeySha256

Declaration
[HttpConverter(TargetEnum.Header, "opc-sse-customer-key-sha256")]
public string OpcSseCustomerKeySha256 { get; set; }
Property Value
Type Description
string

The optional header that specifies the base64-encoded SHA256 hash of the encryption key. This value is used to check the integrity of the encryption key. For more information, see Using Your Own Keys for Server-Side Encryption.

OpcSseKmsKeyId

Declaration
[HttpConverter(TargetEnum.Header, "opc-sse-kms-key-id")]
public string OpcSseKmsKeyId { get; set; }
Property Value
Type Description
string

The OCID of a master encryption key used to call the Key Management service to generate a data encryption key or to encrypt or decrypt a data encryption key.

PutObjectBody

Declaration
[Required(ErrorMessage = "PutObjectBody is required.")]
[HttpConverter(TargetEnum.Body)]
public Stream PutObjectBody { get; set; }
Property Value
Type Description
Stream

The object to upload to the object store.

Remarks

Required

StorageTier

Declaration
[HttpConverter(TargetEnum.Header, "storage-tier")]
public StorageTier? StorageTier { get; set; }
Property Value
Type Description
StorageTier?

The storage tier that the object should be stored in. If not specified, the object will be stored in the same storage tier as the bucket.

Implements

IOciRequest
In this article
Back to top