title: YouTube v3 API caption download using SDK nuget package
body: <p>I'm trying to download a caption track using YouTube API v3 (<a href="https://developers.google.com/youtube/v3/docs/captions/download" rel="nofollow">https://developers.google.com/youtube/v3/docs/captions/download</a>) and official .NET SDK nuget package (<a href="https://www.nuget.org/packages/Google.Apis.YouTube.v3/" rel="nofollow">https://www.nuget.org/packages/Google.Apis.YouTube.v3/</a>, version 1.9.0.1360).</p>
  
  <p>Returned stream contains the following text:</p>
  
  <p>"The OAuth token was received in the query string, which this API forbids for response formats other than JSON or XML. If possible, try sending the OAuth token in the Authorization header instead." </p>
  
  <p>instead of the SRT plain text content which I just uploaded and verified manually through YouTube.com UI.</p>
  
  <p>I found the type of error: lockedDomainCreationFailure</p>
  
  <p>My code:</p>
  
  <pre><code>    ...
          _service = new YTApi.YouTubeService(new BaseClientService.Initializer {
              ApplicationName = config.AppName,
              ApiKey = config.DeveloperKey
          });
      ...
  
      public Stream CaptionsDownload(
          string accessToken,
          string trackId
          )
      {
          var request = _service.Captions.Download(trackId);
          request.OauthToken = accessToken;
          request.Tfmt = YTApi.CaptionsResource.DownloadRequest.TfmtEnum.Srt;
  
          var trackStream = new MemoryStream();
          request.Download(trackStream);
          trackStream.Position = 0;
  
          return trackStream;
      }
  </code></pre>
  
  <p>I cannot seem to find the way to set any headers on _service.HttpClient, and I guess I shouldn't do it manually. I expect that DownloadRequest (or YouTubeBaseServiceRequest) will put </p>
  
  <pre><code>/// &lt;summary&gt;
  /// OAuth 2.0 token for the current user.
  /// &lt;/summary&gt;
  [RequestParameter("oauth_token", RequestParameterType.Query)]
  public virtual string OauthToken { get; set; }
  </code></pre>
  
  <p>into a correct authorization header. I don't see this implemented in the version 1.9.0.1360. </p>
  
  <p>Maybe I'm overlooking something? Any help is greatly appreciated.</p>
  
  <p>Note: I use other caption-related methods with this SDK, and 'download' is the only one I'm having a trouble with.</p>