dtolabs / yana2

Yet Another Node Authority ... because you wanted an agile Real-Time Service Model (RTSM)
8 stars 1 forks source link

API create methods should return a representation #106

Closed ahonor closed 12 years ago

ahonor commented 12 years ago

After creating a resource through the API, a response should include it's representation. It's required to get at least the ID generated by the resource creation to use it again in a subsequent API call (e.g., to associate this ID to another resource).

Eg, for success: 200:

curl --verbose --request POST --header "Content-Type: application/json" -d "{name:'Name',description:'this is the description',filter.id:'1'}" http://localhost:8080/api/attribute/none --cookie cookies.txt

 <attribute id='1' name='Name' description='this is the description' filterId='1' />