title: Passing a custom object to a REST endpoint with C#
body: <p>I have a rest endpoint that accepts a single custom object parameter containing two properties.</p>
  
  <p>Let's call the param InfoParam</p>
  
  <pre><code>public class InfoParam
  {
      public long LongVar { get; set; }
      public string StringVar { get; set; }
  }
  </code></pre>
  
  <p>My code I have is as follows:</p>
  
  <pre><code>infoParam.LongVar = 12345678;
  infoParam.StringVar = "abc"
  
  var myRequest = (HttpWebRequest)WebRequest.Create(url);
  myRequest.Method = "POST";
  
  var content = string.Empty;
  
  using (var theResponse = (HttpWebResponse)MyRequest.GetResponse())
  {
      using (var stream = theResponse.GetResponseStream())
      {
          using (var sr = new StreamReader(stream))
          {
              content = sr.ReadToEnd();
          }
      }
  }
  </code></pre>
  
  <p>So I have the InfoParam variable, with the two values, but I can't figure out where to pass it in to the REST endpoint.</p>