diff --git a/README.md b/README.md index 1d80dbc..207c3c0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ WIP -# Desciption +### Desciption This is an HTTP layer to support REST requests. I think the best use case is a server for turn based games. @@ -10,21 +10,25 @@ The reason I started this project is to learn some c++ while porting this projec Support is always welcome. -# Web-server +### Web-server Add your web files to the public folder. -Supported files: ```png,svg,css,html``` +Supported files: ```png, svg, css, html``` Start the "Game" and open [http://localhost:3560] in your browser. -# Example-Service to quickstart +### Example-Service to quickstart You can test the supported requests with Swagger or Postman. Checkout the swagger.json file with [Swagger-Editor](http://editor.swagger.io/#/) -# Supported verbs +### Godot HTTP client wrapper + +https://github.com/AlexHolly/godot-http + +### Supported verbs * GET * POST @@ -32,7 +36,7 @@ Checkout the swagger.json file with [Swagger-Editor](http://editor.swagger.io/#/ * DELETE * UPDATE -# Add service automatically +### Add service automatically - REST - Some1Service @@ -49,7 +53,7 @@ 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): ``` -# Add service manually +### Add service manually We want to add this url ```GET /user/test``` @@ -62,7 +66,7 @@ func _ready(): add_service("GET", "user/User", [self,"get_user_User"]) ``` -# Header keys IN/OUT upper or lower case? +### Header keys IN/OUT upper or lower case? To leave header keys as they come set IN_HEADER_MODE = IN_HEADER_KEY_KEEP @@ -71,7 +75,7 @@ func _ready(): Same for ```OUT_HEADER_KEY_MODE```. -# Service function +### Service function Each function delivers the following variables @@ -80,9 +84,9 @@ Each function delivers the following variables * header_dict = Contains all params from the url(path (/Name) and query (?Name=) ) * connection = Should be ignored. It contains the StreamPeerTCP -# How to add supported types? +### How to add supported types? -# How to use parameters in url? +### How to use parameters in url? - Query parameters @@ -96,29 +100,29 @@ func post_register(header_dict, body, params_dict, connection): - URL parameters need to start with an upper_case ("Name") in the function name. - ```url: GET http://localhost:3560/user/test?planet=moon``` + ```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} ``` -#BUGS +### TODO -- + - add publish/subscribe service -#TODO + - passive mode - - add accepted formats/ types defaults ["application/json","bytestream","text/html","text/plain"] + - no busy waiting, related https://github.com/godotengine/godot/issues/33479 - - chunked-transfer + - add accepted formats/ types defaults ["application/json","bytestream","text/html","text/plain"] - - no busy waiting + - chunked-transfer - security(https,...) - - passive mode - - send files/images -> bytestream? - - add publish/subscribe service + +### LICENSE +[MIT](./LICENSE)