Swift create or update an object
To create a new object, make a PUT request with the API version, account,
container name, and the name of the new object. You must have write permission on the container to
create or update an object. The object name must be unique within the container. The
PUT request is not idempotent, so if you do not use a unique name, the request will
update the object. However, you can use pseudo-hierarchical syntax in the object name to distinguish
it from another object of the same name if it is under a different pseudo-hierarchical directory.
You can include access control headers and metadata headers in the request.
Syntax
PUT /_AP_VERSION_/_ACCOUNT_/_TENANT_:_CONTAINER_ HTTP/1.1
Host: FULLY_QUALIFIED_DOMAIN_NAME
X-Auth-Token: _AUTH_TOKEN_
Request Headers
ETag
- Description
-
An MD5 hash of the object’s contents. Recommended.
- Type
-
String
- Valid Values
-
N/A
- Required
-
No
Content-Type
- Description
-
An MD5 hash of the object’s contents.
- Type
-
String
- Valid Values
-
N/A
- Required
-
No
Transfer-Encoding
- Description
-
Indicates whether the object is part of a larger aggregate object.
- Type
-
String
- Valid Values
-
chunked - Required
-
No