title: Vimeo API C# - Uploading a video
body: <p>I'm following the api's guide about resumable uploads.
  I managed to get a response after step 1 ("create the video"),
  with a uri and a upload_link.
  About the second part, things are not as clear.
  It only says which headers should I sent, but there are two things I don't get, 
  first - where do I need to put the "upload_link"?
  Should the call be like this:</p>
  
  <p><strong>/me/{upload_link}</strong>? (of course im also adding the access token, etc)</p>
  
  <p>second, what about the actual file? I guess i should send it in the same method, but how? No word about it.</p>
  
  <p>This is the code for the PATCH request:</p>
  
  <pre><code>    public string UploadPatch(
  string uploadlink,
  string method)
  {
  var headers = new WebHeaderCollection()
  {
  
  { "Tus-Resumable", "1.0.0" },
  { "Upload-Offest", "0" }
  
  };
  method = method.ToUpper();
  
  
  string body = "";
  string contentType = "application/offset+octet-stream";
  
  return Helpers.HTTPUpload(uploadlink, method, headers, body, contentType);
  
  }
  </code></pre>
  
  <p>And HTTPUpload():</p>
  
  <pre><code>public static string HTTPPatch(string url, string method,
        WebHeaderCollection headers, string payload,
        string contentType)
      {
          HttpWebRequest request = (HttpWebRequest)WebRequest.CreateHttp(url);
          if (Proxy != null) request.Proxy = Proxy;
  
          request.Headers = headers;
          request.Method = method;
          request.Accept = "application/vnd.vimeo.*+json; version=3.1";
          request.ContentType = contentType;
          request.KeepAlive = false;
  
          if (!String.IsNullOrWhiteSpace(payload))
          {
              var streamBytes = Helpers.ToByteArray(payload);
              request.ContentLength = streamBytes.Length;
              Stream reqStream = request.GetRequestStream();
              reqStream.Write(streamBytes, 0, streamBytes.Length);
              reqStream.Close();
          }
  
          HttpWebResponse response = (HttpWebResponse)(request.GetResponse());
          Debug.WriteLine(((HttpWebResponse)response).StatusDescription);
  
          var dataStream = response.GetResponseStream();
          StreamReader reader = new StreamReader(dataStream);
          string responseFromServer = reader.ReadToEnd();
          reader.Close();
          dataStream.Close();
  
          response.Close();
  
          Debug.WriteLine(String.Format("Response from URL {0}:", url), "HTTPFetch");
          Debug.WriteLine(responseFromServer, "HTTPFetch");
          return responseFromServer;
      }
  </code></pre>
  
  <p>Thanks</p>