Initial commit

This commit is contained in:
2026-07-13 09:25:40 +07:00
parent c08ff54676
commit bccfb156d7
1938 changed files with 641646 additions and 0 deletions

View File

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