using RetroDev.Networking;
using System.Collections.Generic;
using UnityEngine;

public class Delete : MonoBehaviour
{
    private void Start()
    {
        // Example URLs for GET, POST, PUT, and DELETE requests
        string getUrl = "https://jsonplaceholder.typicode.com/posts/1";

        // Example custom headers
        var headers = new Dictionary<string, string>
        {
            { "Authorization", "Bearer your_token_here" },
            { "Custom-Header", "custom_value" },
            { "User-Agent", "CustomUserAgent/1.0" }
        };

        // Perform the request example
        PerformDeleteRequest(getUrl, headers);
    }

    // Example function to perform a DELETE request with custom headers
    private void PerformDeleteRequest(string url, Dictionary<string, string> headers)
    {
        QuickRequest.Delete(url, headers,
            // Success callback
            response =>
            {
                Debug.Log($"DELETE Request Successful.\nResponse: {response}");
            },
            // Error callback
            error =>
            {
                Debug.LogError($"DELETE Request Failed.\nError: {error}");
            });
    }
}
