Example 4: Sending object data in compressed format (Unix)

Here’s a Unix command line that uses the gzip utility to compress the
Q1_2012.ppt file and then pipes the compressed output to a curl command. The curl command makes an HTTP PUT request that sends the data and tells HCP that the data is compressed.

Request with gzip and curl commands

gzip -c Q1_2012.ppt |
    curl -k -T -
    -H "Authorization: HCP bXl1c2Vy:3f3c6784e97531774380db177774ac8d"
    -H "Content-Encoding: gzip"
    "https://finance.europe.hcp.example.com/rest/quarterly_rpts/Q1_2012.ppt"

Request headers

PUT /rest/quarterly_rpts/Q1_2012.ppt HTTP/1.1
Host: /finance.europe.hcp.example.com
Authorization: HCP bXl1c2Vy:3f3c6784e97531774380db177774ac8d
Content-Length: 678400
Transfer-Encoding: chunked
Content-Encoding: gzip
Expect: 100-continue

Response headers

HTTP/1.1 201 Created
X-HCP-ServicedBySystem: hcp.example.com
ETag: "9c604138ffb0f308a8552a3752e5a1be"
Location: /rest/quarterly_rpts/Q1_2012.ppt
X-HCP-VersionId: 79885459513089
X-HCP-Hash: SHA-256 E830B86212A66A792A79D58BB185EE63A4FADA76BB8A1...
X-HCP-Time: 1334862478
Content-Length: 0

Trademarks and Legal Disclaimer

© 2016 Hitachi Data Systems Corporation. All rights reserved.