class SFML::Network::Http

CSFML’s tiny HTTP/1.x client. Useful when an SFML 3 game wants to talk to a leaderboard / asset server without pulling in Net::HTTP. For anything more involved (TLS, redirects, streaming, retries, JSON), Ruby’s stdlib Net::HTTP is the better tool — this wrapper exists for parity with CSFML, not because we recommend it.

http = SFML::Network::Http.new(“localhost”, port: 8080) resp = http.send_request(method: :get, uri: “/”) resp.status #=> 200 resp.body #=> “Hello world\n”

send_request accepts: method: :get / :post / :head / :put / :delete (default :get) uri: path string (default “/”) fields: Hash of header name → value body: String body (POST/PUT) http_version: [major, minor] (default [1, 0]) timeout: SFML::Time or seconds (default 0 = no timeout)