mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-25 23:28:33 -06:00
referencing courses directly from canvas
This commit is contained in:
@@ -5,21 +5,24 @@ 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()
|
||||
{
|
||||
token = Environment.GetEnvironmentVariable("CANVAS_TOKEN") ?? throw new Exception("CANVAS_TOKEN not in environment");
|
||||
token =
|
||||
Environment.GetEnvironmentVariable("CANVAS_TOKEN")
|
||||
?? throw new Exception("CANVAS_TOKEN not in environment");
|
||||
client = new RestClient(BaseUrl);
|
||||
client.AddDefaultHeader("Authorization", $"Bearer {token}");
|
||||
|
||||
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