title: Angular 7 HttpClient post 404
body: <p>I can't seem to get anything other than a GET request to work in my Angular 7 app. Here is the code:</p>
  
  <pre><code>prefix: string = 'assets/data/';
  
  getJsonFile = (fileLocation: string) =&gt; {
      return this.http.get(`${this.prefix}${fileLocation}.json`);
  };
  
  postJsonFile = (fileLocation: string, data: any) =&gt; {
      let headers = new HttpHeaders();
      headers = headers.set('Content-Type', 'application/json');
  
      let options = { headers: headers };
  
      return this.http.put(`${this.prefix}${fileLocation}.json`, data, options);
  };
  </code></pre>
  
  <p>fileLocation is passed in and I am passing the same string, 'selling'.
  The GET returns successfully and the PUT throws a 404 (Not Found) error in the console:</p>
  
  <pre><code>PUT http://localhost:4200/assets/data/selling.json 404 (Not Found) scheduleTask @ zone.js:3243
  ERROR HttpErrorResponse {headers: HttpHeaders, status: 404, statusText: "Not Found", url: "http://localhost:4200/assets/data/selling.json", ok: false, …}
  </code></pre>
  
  <p>Any ideas? Thanks in advance</p>