title: How to escape angular HttpParams?
body: <p>In an Angular Service I'm using HttpParams to send a string to the service:</p>
  
  <pre><code>get(phone: string): Observable&lt;PhoneSearchResponse&gt; {
      let params = new HttpParams();
      params = params.append("phone", phone); // sending "+123456"
      return this._http.get&lt;PhoneSearchResponse&gt;(`${this._apiurl}/Get`, { params: params });
  }
  </code></pre>
  
  <p>When calling get() with <code>+123456</code> as parameter I'll get <code>123456</code> in the receiving service. So somewhere on the way the <code>+</code> gets converted to a space.</p>
  
  <p>Do I need to escape HttpParams to get them unchanged to the service?</p>
  
  <p>If it matters, the backend is an asp.net core project. The called code in the controller:</p>
  
  <pre><code>[HttpGet("[action]")]
  public async Task&lt;JsonResult&gt; Get(string phone) // receiving " 123456"
  {
    return Json(await PhoneSearchLogic.GetAsync(phone));
  }
  </code></pre>
  
  <p>[Update] Very good explanation by Noémi Salaün - but I wonder if changing the parameters is expecteded behaviour "by design"? Or is the problem the ASP.NET Core controller, which should not unescape the + sign (and others)?</p>