Add synchronous InvokeRecAction method
Added a synchronous version of the `InvokeRecAction` method to
the `ReC.Client` namespace in `ReCClient.cs`. This method
invokes the `POST api/RecAction/invoke/{profileId}` endpoint
synchronously using `GetAwaiter().GetResult()` and returns a
boolean indicating success.
Also included XML documentation comments for the new method,
detailing its purpose, parameters, and return value.
This commit is contained in:
parent
b190e4f5e9
commit
4c8e9be695
@ -30,5 +30,16 @@ namespace ReC.Client
|
||||
var resp = await _http.PostAsync($"api/RecAction/invoke/{profileId}", content: null, cancellationToken);
|
||||
return resp.IsSuccessStatusCode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// POST api/RecAction/invoke/{profileId} (Synchronous version)
|
||||
/// </summary>
|
||||
/// <param name="profileId"></param>
|
||||
/// <returns>True if the request was successful, false otherwise</returns>
|
||||
public bool InvokeRecAction(int profileId)
|
||||
{
|
||||
var resp = _http.PostAsync($"api/RecAction/invoke/{profileId}", content: null).GetAwaiter().GetResult();
|
||||
return resp.IsSuccessStatusCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user