From 39f2ae567559b05a112d7f77e8871f5d3b82d142 Mon Sep 17 00:00:00 2001 From: Mikhail <12032252+EvolutionPixG@users.noreply.github.com> Date: Sun, 17 May 2020 19:18:17 +0300 Subject: [PATCH 1/2] Update README.md --- README.md | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 238d5a3..25461bf 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,9 @@ Method example in Some1Service. To use variables in the url you need to make the first character uppercase "Id". - func get_test_Id(header_dict, body, params_dict, connection): +```gdscript +func get_test_Id(header_dict, body, params_dict, connection): +``` # Add service manually @@ -54,9 +56,11 @@ We want to add this url ```GET /user/test``` Create the function that will be executed on ```GET /user/test``` requests and add this function to the service list - func get_user_User(header_dict, body, params_dict, connection): - func _ready(): - add_service("GET", "user/User", [self,"get_user_User"])``` +```gdscript +func get_user_User(header_dict, body, params_dict, connection): +func _ready(): + add_service("GET", "user/User", [self,"get_user_User"]) +``` # Header keys IN/OUT upper or lower case? To leave header keys as they come set @@ -84,18 +88,20 @@ Each function delivers the following variables ```url: POST http://localhost:3560/register?user=test&password=123``` - func post_register(header_dict, body, params_dict, connection): - - print(params) #output { "user":"test","password":123 } +```gdscript + func post_register(header_dict, body, params_dict, connection): + print(params) #output { "user":"test","password":123 } +``` - URL parameters need to start with an upper_case ("Name") in the function name. ```url: GET http://localhost:3560/user/test?planet=moon``` - func get_user_Name(header_dict, body, params_dict, connection): - - print(params) #output {"name":"test","planet":moon} +```gdscript + func get_user_Name(header_dict, body, params_dict, connection): + print(params) #output {"name":"test","planet":moon} +``` #BUGS From 38357e42484fe0a463e1b3f5a9608e2ba71169cf Mon Sep 17 00:00:00 2001 From: Mikhail <12032252+EvolutionPixG@users.noreply.github.com> Date: Sun, 17 May 2020 19:29:16 +0300 Subject: [PATCH 2/2] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 25461bf..1d80dbc 100644 --- a/README.md +++ b/README.md @@ -89,8 +89,8 @@ Each function delivers the following variables ```url: POST http://localhost:3560/register?user=test&password=123``` ```gdscript - func post_register(header_dict, body, params_dict, connection): - print(params) #output { "user":"test","password":123 } +func post_register(header_dict, body, params_dict, connection): + print(params) #output { "user":"test","password":123 } ``` @@ -99,8 +99,8 @@ Each function delivers the following variables ```url: GET http://localhost:3560/user/test?planet=moon``` ```gdscript - func get_user_Name(header_dict, body, params_dict, connection): - print(params) #output {"name":"test","planet":moon} +func get_user_Name(header_dict, body, params_dict, connection): + print(params) #output {"name":"test","planet":moon} ``` #BUGS