dimanche 14 février 2021

PATCH request not working in Ember even though POST is working

hi my POST request code works but when I try doing the exact same thing with PATCH (headers are same), I get a 400 bad request error. I checked and the request payload for this PATCH request works when I hit the request on Postman. Here is the async function I am trying to use:

@action async formSave(input) {
      const url = this.store.adapterFor('home').urlForUpdateRecord(input.id);

      return this.fetch.request(url, {
          method: 'patch',
          headers: {
            'Content-Type': 'application/json'
          },
          data: input
        });
    }

Anyone know why its not working with patch?




Aucun commentaire:

Enregistrer un commentaire