Skip to main content

Cache Delete

Deletes a cache value.

Check URL

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

Response Data

FieldTypeDescription
StatusstringProcessing status

Code Example

void UMyGame::DeleteCache(const FString& CacheKey)
{
// Create request data
// Create request body with player information
TSharedPtr<FJsonObject> Body = FPlayNANOOHelper::CreateRequestBody();
Body->SetStringField(TEXT("cache_key"), CacheKey);

// Convert to JSON string
FString JsonBody = FPlayNANOOHelper::ToJsonString(Body);

// HTTP request
TSharedRef<IHttpRequest> Request = FHttpModule::Get().CreateRequest();
Request->SetURL(TEXT("https://service-api.playnanoo.com/cache/v20241201/del"));
Request->SetVerb(TEXT("PUT"));
FPlayNANOOHelper::SetCommonHeaders(Request, true); // Include auth token
Request->SetContentAsString(JsonBody);

Request->OnProcessRequestComplete().BindLambda(
[](FHttpRequestPtr Req, FHttpResponsePtr Res, bool bSuccess)
{
if (bSuccess && Res.IsValid())
{
TSharedPtr<FJsonObject> JsonObject;
TSharedRef<TJsonReader<>> Reader = TJsonReaderFactory<>::Create(Res->GetContentAsString());

if (FJsonSerializer::Deserialize(Reader, JsonObject))
{
FString Status = JsonObject->GetStringField(TEXT("Status"));
UE_LOG(LogTemp, Log, TEXT("Cache deleted successfully: %s"), *Status);
}
}
});

Request->ProcessRequest();
}
Cache Deletion

You can manage storage space by explicitly deleting cache data that is no longer needed.