title: How can I pass a string to a post request in Angular?
body: <p>I have done some searching and nothing seems to help.</p>
  
  <p>My angular looks like this with username being a string.</p>
  
  <pre><code>getUser(username = null) {
  
  if (username == null) {
    username = this.cookie.getCookieValue("username");
  }
  console.log(JSON.stringify({ username: username }));
  console.log("passing in "+ username);
  
  return this.http.post&lt;User&gt;(this.userBackendUrl + "/user", username, httpOptions).pipe(map(user =&gt; {
    console.log("Successfully got the user!");
    console.log(user);
    return user;
  }));}
  </code></pre>
  
  <p>Backend method looks like </p>
  
  <pre><code>public ActionResult GetUser(string username)
      {
  </code></pre>
  
  <p>I can hit my method but my username string in the backend is always null.</p>