public static async Task <HttpResponseMessage> PostAsync(WilmaSession session, string path, ICollection <KeyValuePair <string, string> > parameters = default, ICollection <KeyValuePair <string, object> > queryParameters = default) { using var request = CreateRequest(session, HttpMethod.Post, path, queryParameters, parameters); return(await _client.SendAsync(request).ConfigureAwait(false)); }
public static HttpRequestMessage CreateRequest(WilmaSession session, HttpMethod method, string path, ICollection <KeyValuePair <string, object> > queryParameters = default, ICollection <KeyValuePair <string, string> > parameters = default) { var request = CreateRequest(session.Context, method, path, queryParameters, parameters); request.Headers.Add("FormKey", session.FormKey); return(request); }
public static async Task <T> GetAsync <T>(WilmaSession session, string path, ICollection <KeyValuePair <string, object> > queryParameters = default, Func <HttpContent, Task <T> > contentDeserializer = default) { using var request = CreateRequest(session, HttpMethod.Get, path, queryParameters); using var response = await _client.SendAsync(request).ConfigureAwait(false); return(await DeserializeContentAsync(response, contentDeserializer).ConfigureAwait(false)); }
public MessageApi(WilmaSession session, Role role) { _session = session; _role = role; }
public AttendanceApi(WilmaSession session, Role role) { _session = session; _role = role; }
public NewsApi(WilmaSession session, Role role) { _session = session; _role = role; }
public async Task <bool> LogoutAsync(WilmaSession session) { using var response = await WAPI.PostAsync(session, "/logout").ConfigureAwait(false); return(response.IsSuccessStatusCode); }
public GroupApi(WilmaSession session, Role role) { _role = role; _session = session; }
public ExamApi(WilmaSession session, Role role) { _role = role; _session = session; }