Skip to content

Commit

Permalink
header size in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexHolly committed May 18, 2020
1 parent d14143c commit 688795f
Showing 1 changed file with 25 additions and 21 deletions.
46 changes: 25 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -10,29 +10,33 @@ 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
* PUT
* DELETE
* UPDATE

# Add service automatically
### Add service automatically

- REST
- Some1Service
Expand All @@ -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```

Expand All @@ -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
Expand All @@ -71,7 +75,7 @@ func _ready():

Same for ```OUT_HEADER_KEY_MODE```.

# Service function
### Service function

Each function delivers the following variables

Expand All @@ -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

Expand All @@ -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)

0 comments on commit 688795f

Please sign in to comment.