NAME

Mojo::Leds::Rest - Abstract class for RESTFul webservices interface

VERSION

version 0.02

RESTFul API

create

PUT /url/

create a new record

Parameters:

  • body JSON - {col1: ..., col2:... }

Return:

  • Created record in JSON {_id:...., col1:. ...., }

read

GET /url/id

return a single record with _id: id

Parameters:

  • None

Return:

  • Record found in JSON {_id:...., col1:. ...., }

update

PUT /url/id

update a single record

Parameters:

  • body JSON - {_id:...., col1: new_value, col2: new_value, }

Return:

  • Updated record in JSON {_id:...., col1:. ...., }

delete

DELETE /url/id

delete a record

Parameters:

  • None

Return:

  • Empty body

  • HTTP Status: 204 No Content

list

GET /url/

return all records

Parameters:

  • None

Return:

  • All records in JSON array: [ {_id:...., }, {_id:...., }, ...} ]

listupdate

POST /url/

update/creare multi records. Record with _id is updated, record without _id is created.

Parameters:

  • body JSON array: [ {col1,... }, {_id:...., col1: new_value, col2: new_value, } ]

Return:

  • Created/ Updated record in JSON [{_id:...., col1:. ...., }, ...]

AUTHOR

Emiliano Bruni <info@ebruni.it>

COPYRIGHT AND LICENSE

This software is copyright (c) 2021 by Emiliano Bruni.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.