Swarkin / Godot-AwaitableHTTPRequest

Addon to ease the usage of HTTP Requests in Godot
51 stars 6 forks source link

Feature Request: Automate HttpRequest Header & Authentication #9

Closed EiTaNBaRiBoA closed 1 month ago

EiTaNBaRiBoA commented 1 month ago

Current difficulties

Proposed Improvements

Benefits

Example Usage

var request = HttpRequest.new()
request.url = "https://api.example.com/data"
request.method = HTTPClient.METHOD_POST
request.auth = {"type": "Bearer", "token": "my_bearer_token"}
# Content-type is auto-detected based on request.body 
Swarkin commented 1 month ago

Hi!

I want to keep the API simple and close to the regular HTTPRequest Node, which allows the dev total control over its behaviour. In order to implement most features you mentioned (for example; auto-detection of the content type), the API would have to be expanded and/or changed drastically which I don't think fits very well into this addon. On top of that, ambiguous behaviour would be introduced which is something that may lead to confusion and again contradict my initial goal of providing a simple, almost drop-in awaitable solution for HTTP requests.

You are welcome to create a fork and implement your changes, as well as upload it to the asset lib as a separate addon for users in need of more advanced HTTP Nodes.

I appreciate your interest in the addon!