{"action":"created","issue":{"url":"https://api.github.com/repos/google/google-api-go-client/issues/31","labels_url":"https://api.github.com/repos/google/google-api-go-client/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/google/google-api-go-client/issues/31/comments","events_url":"https://api.github.com/repos/google/google-api-go-client/issues/31/events","html_url":"https://github.com/google/google-api-go-client/issues/31","id":65758247,"number":31,"title":"bigquery JobsInsertCall.Do() should always use application/octet-stream for media","user":{"login":"gmlewis","id":6598971,"avatar_url":"https://avatars.githubusercontent.com/u/6598971?v=3","gravatar_id":"","url":"https://api.github.com/users/gmlewis","html_url":"https://github.com/gmlewis","followers_url":"https://api.github.com/users/gmlewis/followers","following_url":"https://api.github.com/users/gmlewis/following{/other_user}","gists_url":"https://api.github.com/users/gmlewis/gists{/gist_id}","starred_url":"https://api.github.com/users/gmlewis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmlewis/subscriptions","organizations_url":"https://api.github.com/users/gmlewis/orgs","repos_url":"https://api.github.com/users/gmlewis/repos","events_url":"https://api.github.com/users/gmlewis/events{/privacy}","received_events_url":"https://api.github.com/users/gmlewis/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/google/google-api-go-client/labels/new","name":"new","color":"FFFFFF"},{"url":"https://api.github.com/repos/google/google-api-go-client/labels/priority-medium","name":"priority-medium","color":"FFFFFF"},{"url":"https://api.github.com/repos/google/google-api-go-client/labels/type-defect","name":"type-defect","color":"FFFFFF"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-01T19:16:19Z","updated_at":"2015-04-07T06:29:58Z","closed_at":null,"body":"\n**gavaletz** on 2 May 2013 at 2:36:\n\n```\nWhat steps will reproduce the problem?\n1. Create bigquery.Service\n2. Add Job to load data to BigQuery with CSV data provided as POST\n3. add Media\n4. call Do\n\nWhat is the expected output? What do you see instead?\nMedia (CSV data) should be added with \"Content-Type: application/octet-stream\"\n\nIf it is compressed it gets added with application/gzip and if the CSV data is \nnot compressed (as created by http://golang.org/pkg/encoding/csv/) it is \nidentified as text/plain.\n\nWhat version of the product are you using? On what operating system?\nGo working from tip\ngoogle-api-go-client working from tip\nLinux x86_64\n\nPlease provide any additional information below.\nAccording to the documentation provided for BigQuery the data section of the \nload job should always have the content type application/octet-stream.  You can \nwork around this by creating a custom io.Reader that satisfies the type \ngoogleapi.ContentTyper interface, but that is not obvious and there is no case \nwhere this function should use anything other than content type \napplication/octet-stream.\n\nfunc (c *JobsInsertCall) Do() (*Job, error) {\n         ...\n        contentLength_, hasMedia_ := googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype)\n         ...\n}\n\nThis is just another pitfall for anyone brave/dumb enough to try to use Go with \nBigQuery - myself included.\n```\n\n\n\n"},"comment":{"url":"https://api.github.com/repos/google/google-api-go-client/issues/comments/90392732","html_url":"https://github.com/google/google-api-go-client/issues/31#issuecomment-90392732","issue_url":"https://api.github.com/repos/google/google-api-go-client/issues/31","id":90392732,"user":{"login":"gmlewis","id":6598971,"avatar_url":"https://avatars.githubusercontent.com/u/6598971?v=3","gravatar_id":"","url":"https://api.github.com/users/gmlewis","html_url":"https://github.com/gmlewis","followers_url":"https://api.github.com/users/gmlewis/followers","following_url":"https://api.github.com/users/gmlewis/following{/other_user}","gists_url":"https://api.github.com/users/gmlewis/gists{/gist_id}","starred_url":"https://api.github.com/users/gmlewis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmlewis/subscriptions","organizations_url":"https://api.github.com/users/gmlewis/orgs","repos_url":"https://api.github.com/users/gmlewis/repos","events_url":"https://api.github.com/users/gmlewis/events{/privacy}","received_events_url":"https://api.github.com/users/gmlewis/received_events","type":"User","site_admin":false},"created_at":"2015-04-07T06:29:58Z","updated_at":"2015-04-07T06:29:58Z","body":"Successfully auto-migrated from code.google.com:\r\nhttps://code.google.com/p/google-api-go-client/issues/detail?id=31"}}