title: YamlDotNet "Expected 'StreamEnd', got 'DocumentStart'"when reading string
body: <p>I'm using YamlDotNet with an Azure Function v2 to serialise YAML from a markdown file (hosted on GitHub) to a .net object. I'm struggling with this error when attempting to deserialize the YAML string</p>
  
  <p><code>Expected 'StreamEnd', got 'DocumentStart</code></p>
  
  <p>I'm getting the markdown file content using <code>HttpClient</code> with a GET request to <a href="https://github.com/martinkearn/Content/raw/fd83bf8218b7c5e01f8b498e8a831bcd3fc3c961/Blogs/Test.md" rel="nofollow noreferrer">https://github.com/martinkearn/Content/raw/fd83bf8218b7c5e01f8b498e8a831bcd3fc3c961/Blogs/Test.md</a> which returns a raw markdown file in the response body.</p>
  
  <p>My Model is </p>
  
  <pre><code>public class Article
  {
      public string Title { get; set; }
      public string Author { get; set; }
      public List&lt;string&gt; Categories { get; set; }
  }
  </code></pre>
  
  <p>My YAML is </p>
  
  <pre><code>---
  title: Test File 
  author: Martin Kearn  
  categories:
    - Test
    - GitHubCMS 
    - One More Tag
    - another tag
  ---
  </code></pre>
  
  <p>Here is my code</p>
  
  <pre><code>// get url from request body
  var url = "https://raw.githubusercontent.com/martinkearn/Content/fd83bf8218b7c5e01f8b498e8a831bcd3fc3c961/Blogs/Test.md";
  
  // get raw file and extract YAML
  using (var client = new HttpClient())
  {
      //setup HttpClient
      client.BaseAddress = new Uri(url);
      client.DefaultRequestHeaders.Add("User-Agent", "ExtractYAML Function");
  
      //setup httpContent object
      var response = await client.GetAsync(url);
  
      string rawFile = await response.Content.ReadAsStringAsync();
      using (var r = new StringReader(rawFile))
      {
          var deserializer = new DeserializerBuilder()
              .WithNamingConvention(new CamelCaseNamingConvention())
              .Build();
  
          //This line is causing Expected 'StreamEnd', got 'DocumentStart'
          var article = deserializer.Deserialize&lt;Article&gt;(r);
      }
  }
  </code></pre>