Skip to content

m-canton/godot-http-manager

Repository files navigation

HTTP Manager Plugin for Godot

Introduction

This plugin adds a HTTPManager autoload to make multiple requests using routes defined with resources.

Routes have attached a client, resource that defines the host. You can add constraints to the client like requests per second.

Example:

extends Node

const ROUTE := preload("res://path/to/route.tres")

func _request_posts() -> void:
    if ROUTE.create_request().start(_on_request_completed) == OK:
        pass # Disable buttons or do other tasks

func _on_request_completed(response: HTTPManagerResponse) -> void:
    var data = response.parse()
    if response.successful:
        print(data)
    else:
        push_error("Request error.")

See wiki to know how to use this plugin.

Requirements

  • Godot version: 4.3