# createAction(api, moduleName)
Create a new resource
Allowed Responses:
201 Created
If the resource did not have a client-generated id, this is the server response for successful creates. The response body must include the generated resource.
If a client-generated id was sent to the server, the response id must match the request id.
202 Accepted
As with the delete action, this library tries to handle accepted as a success state. If the resource was sent with a client-generated id, it will be committed to the store as is, however, if no id is present, an error will be thrown.
204 No content
For resources with client-generated ids, a 204 response from the server will commit the provided resource to the store module.
Kind: global function
Param | Type |
---|---|
api | ResourcefulApi |
moduleName | String |