namespace RobotNet10.Script.IO; /// /// Interface for HTTP connection operations. /// public interface IHttpConnection : IDisposable { /// /// Gets the base URL of the HTTP connection. /// string BaseUrl { get; } /// /// Gets whether the connection is currently connected. /// bool IsConnected { get; } /// /// Connects to the HTTP endpoint. /// Task ConnectAsync(); /// /// Disconnects from the HTTP endpoint. /// Task DisconnectAsync(); /// /// Sends a GET request to the specified path. /// /// The path relative to BaseUrl. /// Optional headers to include in the request. /// The response content as string. Task GetAsync(string path, Dictionary? headers = null); /// /// Sends a POST request to the specified path. /// /// The path relative to BaseUrl. /// The content to send. /// The content type (default: application/json). /// Optional headers to include in the request. /// The response content as string. Task PostAsync(string path, string content, string contentType = "application/json", Dictionary? headers = null); /// /// Sends a PUT request to the specified path. /// /// The path relative to BaseUrl. /// The content to send. /// The content type (default: application/json). /// Optional headers to include in the request. /// The response content as string. Task PutAsync(string path, string content, string contentType = "application/json", Dictionary? headers = null); /// /// Sends a DELETE request to the specified path. /// /// The path relative to BaseUrl. /// Optional headers to include in the request. /// The response content as string. Task DeleteAsync(string path, Dictionary? headers = null); }