Gnurou
Gnurou

Reputation: 8153

How to set the fields parameter in a Google Drive Go API call?

As explained on

https://developers.google.com/drive/web/performance#partial-response

Once can set the "fields" parameter of an HTTP request to obtain a partial response containing only the fields explicitly requested. There are many examples on how to do this in languages like Python, but I could not find anything using the Go API. The FilesListCall type has no method that allows to do this, and I also cannot find any other way to tweak the HTTP request send by the Go API.

Is there a way to do this at all, or am we condamned to transfer large amounts of unneeded data?

Upvotes: 0

Views: 628

Answers (1)

Gnurou
Gnurou

Reputation: 8153

As Intermernet explained, the feature was just not implemented when I asked the question. However, after posting a comment on the opened feature request, a Google engineer immediatly implemented it:

http://godoc.org/code.google.com/p/google-api-go-client/googleapi#Field

Thanks to Google for the quick reaction on this much needed feature!

Upvotes: 1

Related Questions