0
votes

On postman if I sent a put request with the params set to raw JSON with

{"quote": "hellos","author":"mes"}

This will put into the api I set up. However when on my ember app which I proxied on the same server using port:8080 for my Ember app. I am using c9.io

 ember server --proxy=http://localhost:8081 --live-reload false

I get an error for my .put statement in my api, oddly enough DELETE and GET have zero issues from my ember app. The error I receive from the console is.

ember.debug.js:32096 Error: Ember Data Request PATCH /quotes/575f110955fdd3a21c86d731 
returned a 404 Payload (Empty Content-Type) Cannot PATCH /quotes/575f110955fdd3a21c86d731

I have noticed that here in my routes file on the node server that the .put function isn't even called because I get zero output from the console.log.

I made a git repository of the little project and the places too take a good look at are listed with 6.14.16.2 PATCH error or error PATCH.

server

EmberApp

1

1 Answers

0
votes

By default ember is using its JSONAPI adapter, which means it will send "PATCH" requests instead of "PUT when saving objects.

You need to create you own application adapter and extend the embers REST adapter:

//adapters/application.js

import RESTAdapter from 'ember-data/adapters/rest';

export default RESTAdapter.extend({
});