When using a remote blobstore, such as AWS, the response is a redirect to the actual location of the bits. If the client is automatically following redirects, then the OAuth token that was used to communicate with Cloud Controller will be replayed on the new redirect request. Some blobstores may reject the request in that case. Clients may need to follow the redirect without including the OAuth token.
POST /v3/packages/guid-b52cf015-9866-473e-9e51-55926e639470/upload
bits_name=application.zip&bits_path=%2Ftmp%2Fd20160219-24373-1f6o5uj%2Fapplication.zip
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI3IiwiZW1haWwiOiJlbWFpbC0yNkBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIucmVhZCIsImNsb3VkX2NvbnRyb2xsZXIud3JpdGUiXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDU2NDUyMjIxfQ.kXue_cDdkxywGF_FxgZ5vQF8Ax5rsb2R5DeKH-kLBdc Host: example.org Content-Type: application/x-www-form-urlencoded Cookie:
curl "https://api.[your-domain.com]/v3/packages/guid-b52cf015-9866-473e-9e51-55926e639470/upload" -d 'bits_name=application.zip&bits_path=%2Ftmp%2Fd20160219-24373-1f6o5uj%2Fapplication.zip' -X POST \ -H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI3IiwiZW1haWwiOiJlbWFpbC0yNkBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIucmVhZCIsImNsb3VkX2NvbnRyb2xsZXIud3JpdGUiXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDU2NDUyMjIxfQ.kXue_cDdkxywGF_FxgZ5vQF8Ax5rsb2R5DeKH-kLBdc" \ -H "Host: example.org" \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "Cookie: "
200 OK
{ "guid": "guid-b52cf015-9866-473e-9e51-55926e639470", "type": "bits", "data": { "error": null, "hash": { "type": "sha1", "value": null } }, "state": "PROCESSING_UPLOAD", "created_at": "2016-02-19T02:03:41Z", "updated_at": "2016-02-19T02:03:41Z", "links": { "self": { "href": "/v3/packages/guid-b52cf015-9866-473e-9e51-55926e639470" }, "upload": { "href": "/v3/packages/guid-b52cf015-9866-473e-9e51-55926e639470/upload", "method": "POST" }, "download": { "href": "/v3/packages/guid-b52cf015-9866-473e-9e51-55926e639470/download", "method": "GET" }, "stage": { "href": "/v3/packages/guid-b52cf015-9866-473e-9e51-55926e639470/droplets", "method": "POST" }, "app": { "href": "/v3/apps/guid-62ef2f07-a028-4875-b192-9ee510d80ec5" } } }
X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block X-Content-Type-Options: nosniff Content-Type: application/json; charset=utf-8 X-Runtime: 0.022041 Content-Length: 860
GET /v3/packages/guid-b52cf015-9866-473e-9e51-55926e639470
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI3IiwiZW1haWwiOiJlbWFpbC0yNkBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIucmVhZCIsImNsb3VkX2NvbnRyb2xsZXIud3JpdGUiXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDU2NDUyMjIxfQ.kXue_cDdkxywGF_FxgZ5vQF8Ax5rsb2R5DeKH-kLBdc Host: example.org Cookie:
curl "https://api.[your-domain.com]/v3/packages/guid-b52cf015-9866-473e-9e51-55926e639470" -X GET \ -H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI3IiwiZW1haWwiOiJlbWFpbC0yNkBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIucmVhZCIsImNsb3VkX2NvbnRyb2xsZXIud3JpdGUiXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDU2NDUyMjIxfQ.kXue_cDdkxywGF_FxgZ5vQF8Ax5rsb2R5DeKH-kLBdc" \ -H "Host: example.org" \ -H "Cookie: "
200 OK
{ "guid": "guid-b52cf015-9866-473e-9e51-55926e639470", "type": "bits", "data": { "error": null, "hash": { "type": "sha1", "value": "f7dc8b22b2abfa8d90b6d421660613025d861438" } }, "state": "READY", "created_at": "2016-02-19T02:03:41Z", "updated_at": "2016-02-19T02:03:41Z", "links": { "self": { "href": "/v3/packages/guid-b52cf015-9866-473e-9e51-55926e639470" }, "upload": { "href": "/v3/packages/guid-b52cf015-9866-473e-9e51-55926e639470/upload", "method": "POST" }, "download": { "href": "/v3/packages/guid-b52cf015-9866-473e-9e51-55926e639470/download", "method": "GET" }, "stage": { "href": "/v3/packages/guid-b52cf015-9866-473e-9e51-55926e639470/droplets", "method": "POST" }, "app": { "href": "/v3/apps/guid-62ef2f07-a028-4875-b192-9ee510d80ec5" } } }
X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block X-Content-Type-Options: nosniff Content-Type: application/json; charset=utf-8 X-Runtime: 0.014168 Content-Length: 886
GET /v3/packages/guid-b52cf015-9866-473e-9e51-55926e639470/download
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI3IiwiZW1haWwiOiJlbWFpbC0yNkBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIucmVhZCIsImNsb3VkX2NvbnRyb2xsZXIud3JpdGUiXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDU2NDUyMjIxfQ.kXue_cDdkxywGF_FxgZ5vQF8Ax5rsb2R5DeKH-kLBdc Host: example.org Cookie:
curl "https://api.[your-domain.com]/v3/packages/guid-b52cf015-9866-473e-9e51-55926e639470/download" -X GET \ -H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI3IiwiZW1haWwiOiJlbWFpbC0yNkBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIucmVhZCIsImNsb3VkX2NvbnRyb2xsZXIud3JpdGUiXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDU2NDUyMjIxfQ.kXue_cDdkxywGF_FxgZ5vQF8Ax5rsb2R5DeKH-kLBdc" \ -H "Host: example.org" \ -H "Cookie: "
302 Found
X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block X-Content-Type-Options: nosniff Location: https://cc-packages.s3.amazonaws.com/gu/id/guid-b52cf015-9866-473e-9e51-55926e639470?X-Amz-Expires=3600&X-Amz-Date=20160219T020341Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=fake_aws_key_id/20160219/us-east-1/s3/aws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=69103cb29a7b83392603283fec9a7dd991b63f8698188b1488d91672530fbdd8 Content-Type: text/html; charset=utf-8 X-Runtime: 0.015585 Content-Length: 424