ArchiSteamFarm/IPC/Controllers/Api/StorageController.cs
/// <summary>
///     Saves entry under specified key in ASF's persistent KeyValue JSON storage.
/// </summary>
Saves entry under specified key in ASF's persistent KeyValue JSON storage.
Saves entry under specified key in ASF ' s persistent KeyValue JSON storage .
[Consumes("application/json")]
	[HttpPost]
	[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.OK)]
	public ActionResult<GenericResponse> StoragePost(string key, [FromBody] JToken value) {
		if (string.IsNullOrEmpty(key)) {
			throw new ArgumentNullException(nameof(key));
		}
		ArgumentNullException.ThrowIfNull(value);
		if (ASF.GlobalDatabase == null) {
			throw new InvalidOperationException(nameof(ASF.GlobalDatabase));
		}
		if (value.Type == JTokenType.Null) {
			ASF.GlobalDatabase.DeleteFromJsonStorage(key);
		} else {
			ASF.GlobalDatabase.SaveToJsonStorage(key, value);
		}
		return Ok(new GenericResponse(true));
	}
[ Consumes ( " " ) ] [ HttpPost ] [ ProducesResponseType ( typeof ( GenericResponse ) , ( int ) HttpStatusCode . OK ) ] public ActionResult < GenericResponse > StoragePost ( string key , [ FromBody ] JToken value ) { if ( string . IsNullOrEmpty ( key ) ) { throw new ArgumentNullException ( nameof ( key ) ) ; } ArgumentNullException . ThrowIfNull ( value ) ; if ( ASF . GlobalDatabase == null ) { throw new InvalidOperationException ( nameof ( ASF . GlobalDatabase ) ) ; } if ( value . Type == JTokenType . Null ) { ASF . GlobalDatabase . DeleteFromJsonStorage ( key ) ; } else { ASF . GlobalDatabase . SaveToJsonStorage ( key , value ) ; } return Ok ( new GenericResponse ( true ) ) ; }
Saves entry under specified key in ASF's persistent KeyValue JSON storage.
Saves entry under specified key in ASF ' s persistent KeyValue JSON storage .
key
string
JToken
[FromBody]