Quantcast
Viewing all articles
Browse latest Browse all 3637

REST API : write only resource. What to send back?

Basically, I want to POST a resource C to the server.Depending on cases, the creation of a resource C may create resources A and B too.As relationship matters, C is nested in B, himself nested in A.

In that case, we need to POST more data than just the resource C, hence, we'll be POSTing a write only resource, D, that doesn't have any meaning expect in this case.

My question is : What shall my API send back? 200 Okay, 201 Created? Shall I send the created resource C?


Viewing all articles
Browse latest Browse all 3637

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>