title: WebDAV get free space info
body: <p>I'm working with Yandex Disk API (<a href="http://api.yandex.com/disk/doc/dg/reference/propfind_space-request.xml" rel="nofollow">http://api.yandex.com/disk/doc/dg/reference/propfind_space-request.xml</a>).
  Having trouble with adding property in the request body (<strong>quota-available-bytes</strong> and <strong>quota-used-bytes</strong>)</p>
  
  <pre><code>public static string SpaceInfo(string path)
  {
      // Authorization.
      HttpWebRequest webReq = (HttpWebRequest)WebRequest.Create("https://webdav.yandex.ru/");
      webReq.Accept = "*/*";
      webReq.Headers.Add("Depth: 0");
      webReq.Headers.Add("Authorization: OAuth " + token);
      webReq.Method = "PROPFIND";
  
      // Adding data in body request.
      string inputData = @"&lt;D:propfind xmlns:D=""DAV:""&gt;&lt;D:prop&gt;&lt;quota-available-bytes/&gt;&lt;/D:prop&gt;&lt;/D:propfind&gt;";
      byte[] buffer = new ASCIIEncoding().GetBytes(inputData);
  
      webReq.ContentType = "text/xml; encoding='utf-8";
      webReq.ContentLength = buffer.Length;
  
      try
      {
          HttpWebResponse resp = (HttpWebResponse)webReq.GetResponse();
          StreamReader sr = new StreamReader(resp.GetResponseStream());
          string dinfo = sr.ReadToEnd();
  
          return dinfo;
      }
  }
  </code></pre>
  
  <p>I don't get any response, maybe i can use another method? What should i do?
  Thanks!</p>