Skip to main content

Cache Delete

API for deleting cache values.

URL Confirmation

This API uses the service-api.playnanoo.com domain.

API Information

  • URL: https://service-api.playnanoo.com/cache/v20241201/del
  • Method: PUT
  • Authentication Required: Yes

Request Parameters

ParameterTypeRequiredDescription
cache_keystringRequiredCache key to delete
DeviceInfo Inheritance

The Req class of this API inherits from DeviceInfo. All properties of DeviceInfo are automatically included.

Response Data

Res Class

FieldTypeDescription
StatusstringProcessing status

Unity C# Implementation

using System;
using System.Collections;
using UnityEngine.Networking;

public class CacheDel
{
static string path = "https://service-api.playnanoo.com/cache/v20241201/del";

[Serializable]
public class Req : DeviceInfo
{
public string cache_key;

public IEnumerator Send(string cache_key, Action<Res> onSuccess, Action<BaseResponse> onError)
{
if (!string.IsNullOrEmpty(cache_key)) this.cache_key = cache_key;

yield return HttpClient.Send<Req, Res>(
UnityWebRequest.kHttpVerbPUT,
path,
requireToken: true,
body: this,
onSuccess: onSuccess,
onError: onError
);
}
}

[Serializable]
public class Res : BaseResponse
{
public string Status;
}
}

Usage Example

public void DeleteCache()
{
CacheDel.Req req = new CacheDel.Req();

StartCoroutine(req.Send(
cache_key: "player_temp_data",
onSuccess: res =>
{
Debug.Log($"Cache deleted: {res.Status}");
},
onError: (error) =>
{
Debug.LogError($"Del failed: [{error.ErrorCode}] [{error.Message}]");
}
));
}