mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-25 23:28:33 -06:00
commit pre-purge
This commit is contained in:
26
Management/Services/WebRequestor.cs
Normal file
26
Management/Services/WebRequestor.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using RestSharp;
|
||||
|
||||
public class WebRequestor : IWebRequestor
|
||||
{
|
||||
private const string BaseUrl = "https://snow.instructure.com/api/v1/";
|
||||
private string token;
|
||||
private RestClient client;
|
||||
private string courseid { get; }
|
||||
public WebRequestor(RestClient client)
|
||||
{
|
||||
// token = Environment.GetEnvironmentVariable("CANVAS_TOKEN");
|
||||
// client = new RestClient(BaseUrl);
|
||||
// client.AddDefaultHeader("Authorization", $"Bearer {token}");
|
||||
|
||||
this.client = client;
|
||||
courseid = "774898";
|
||||
}
|
||||
public async Task<RestResponse<T[]>> GetManyAsync<T>(RestRequest request)
|
||||
{
|
||||
return await client.ExecuteGetAsync<T[]>(request);
|
||||
}
|
||||
public async Task<RestResponse<T>> GetAsync<T>(RestRequest request)
|
||||
{
|
||||
return await client.ExecuteGetAsync<T>(request);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user