Skip to content

Commit 35c8608

Browse files
committed
Change REST HTTP method convention
1 parent 11bdcfb commit 35c8608

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

RPC_API

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
RESTful
22

33
GET = Get request
4-
POST = Partial update of an object
5-
PUT = Create new object
4+
POST = Create new object
5+
PUT = Partial update of an object
66
DELETE = Delete object
77

88
HTTP:
@@ -30,8 +30,8 @@ SOAP 1.1
3030

3131
RESTful to CRUD name conversion:
3232
GET => READ
33-
POST => UPDATE
34-
PUT => CREATE
33+
POST => CREATE
34+
PUT => UPDATE
3535
DELETE => DELETE
3636

3737
Function name conversion:

lib/Lim/RPC/Protocol/REST.pm

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ our $VERSION = $Lim::VERSION;
3131
our $JSON = JSON::XS->new->ascii->convert_blessed;
3232
our %REST_CRUD = (
3333
GET => 'READ',
34-
POST => 'UPDATE',
35-
PUT => 'CREATE',
34+
PUT => 'UPDATE',
35+
POST => 'CREATE',
3636
DELETE => 'DELETE'
3737
);
3838

lib/Lim/Util.pm

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ See L<Lim> for version.
3131

3232
our $VERSION = $Lim::VERSION;
3333
our %CALL_METHOD = (
34-
Create => 'PUT',
34+
Create => 'POST',
3535
Read => 'GET',
36-
Update => 'POST',
36+
Update => 'PUT',
3737
Delete => 'DELETE'
3838
);
3939

0 commit comments

Comments
 (0)