- Mark as New
- Follow
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
Okay then I think there's something wrong with your API.
I think what is going on is that your API:
- Accepts JSON correctly.
- Stores the object correctly.
- Returns the JSON wrong.
I have the feeling your API might accept application/json but returns application/text or something like that, can you check?
Basically what should happen when you create a resource is that your API should return the same thing you sent to it, plus the ID of the created resource. For example:
Create a resource
POST /address
{"street": "this is a \" test"}
>>> {"id": "1", "street": "this is a \" test"}
Fetch a resource
GET /address/1
>>> {"id": "1", "street": "this is a \" test"}
Database content
id street
----- ----------------
1 this is a " test