Here is the request and response
**Request URL:https://www.googleapis.com/upload/drive/v2/files/0B6B-RNrxsCu2S0xxSkZQUEQ3eDQ?uploadType=media**
Request Method:OPTIONS
Status Code:200 OK
Request Headersview source
:host:www.googleapis.com
:method:OPTIONS
:path:/upload/drive/v2/files/0B6B-RNrxsCu2S0xxSkZQUEQ3eDQ?uploadType=media
:scheme:https
:version:HTTP/1.1
accept:*/*
accept-encoding:gzip,deflate,sdch
accept-language:en-US,en;q=0.8,en-AU;q=0.6
access-control-request-headers:accept, content-type, authorization, upload-content-length, upload-content-type
access-control-request-method:PUT
origin:http://dev.example.co:8888
referer:http://dev.example.co:8888/app/drivecrud.html
user-agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.114 Safari/537.36
Query String Parametersview sourceview URL encoded
uploadType:media
**Response Headersview source**
alternate-protocol:443:quic
cache-control:no-cache, no-store, max-age=0, must-revalidate
content-length:0
content-type:application/octet-stream
date:Fri, 18 Apr 2014 06:46:58 GMT
expires:Fri, 01 Jan 1990 00:00:00 GMT
pragma:no-cache
server:HTTP Upload Server Built on Apr 11 2014 13:30:54 (1397248254)
status:200 OK
version:HTTP/1.1
Fails with ...
OPTIONS https://www.googleapis.com/upload/drive/v2/files/0B6B-RNrxsCu2S0xxSkZQUEQ3eDQ?uploadType=media
Origin http://dev.example.co:8888 is not allowed by Access-Control-Allow-Origin.
By way of confirmation that everything else seems OK...
- I just created the file that I'm uploading content to, so it's not permissions
- If I replace uploadType=media -> =multipart, then I can correctly create a new file with content.
So it feels like one of
- I've mis-formed the request in some way
- Drive bug
The Drive API is documented at https://developers.google.com/drive/web/manage-uploads#simple
so I'm asking, is my request not as specified by the API, or it is as specified and the API is broken.