Beispiel #1
0
 /// <summary>
 /// Create a new LISResult instance within the server.
 /// </summary>
 /// <param name="client">The HttpClient that will be used to process the request.</param>
 /// <param name="serviceUrl">The LISResult container REST endpoint.</param>
 /// <param name="consumerKey">The OAuth consumer key to use to form the Authorization header.</param>
 /// <param name="consumerSecret">The OAuth consumer secret to use to form the Authorization header.</param>
 /// <param name="result">The LISResult to create within the server.</param>
 /// <param name="signatureMethod">The signatureMethod. Defaults to <see cref="SignatureMethod.HmacSha1"/></param>
 /// <param name="deserializationErrorHandler">A deserialization error handler. Defaults to null.</param>
 /// <returns>If successful, the LISResult with @id filled in.</returns>
 public static async Task <ClientResponse <Result> > PostResultAsync(HttpClient client, string serviceUrl, string consumerKey,
                                                                     string consumerSecret, Result result, SignatureMethod signatureMethod = SignatureMethod.HmacSha1,
                                                                     EventHandler <Newtonsoft.Json.Serialization.ErrorEventArgs> deserializationErrorHandler = null)
 {
     return(await PostOutcomeAsync
            (
                client, serviceUrl, consumerKey, consumerSecret, result, LtiConstants.LisResultMediaType,
                signatureMethod, deserializationErrorHandler
            )
            .ConfigureAwait(false));
 }
 /// <summary>
 /// Update a particular LISResult instance within the server.
 /// </summary>
 /// <param name="client">The HttpClient that will be used to process the request.</param>
 /// <param name="serviceUrl">The LISResult REST endpoint.</param>
 /// <param name="consumerKey">The OAuth consumer key to use to form the Authorization header.</param>
 /// <param name="consumerSecret">The OAuth consumer secret to use to form the Authorization header.</param>
 /// <param name="result">The LISResult to be updated within the server.</param>
 /// <param name="signatureMethod">The signatureMethod. Defaults to <see cref="SignatureMethod.HmacSha1"/></param>
 /// <returns>No content is returned.</returns>
 public static async Task <ClientResponse> PutResultAsync(HttpClient client, string serviceUrl, string consumerKey, string consumerSecret, Result result,
                                                          SignatureMethod signatureMethod = SignatureMethod.HmacSha1)
 {
     return(await PutOutcomeAsync(client, serviceUrl, consumerKey, consumerSecret, result, LtiConstants.LisResultMediaType, signatureMethod)
            .ConfigureAwait(false));
 }
 /// <summary>
 /// Update a particular LISResult instance within the server.
 /// </summary>
 /// <param name="client">The HttpClient that will be used to process the request.</param>
 /// <param name="serviceUrl">The LISResult REST endpoint.</param>
 /// <param name="consumerKey">The OAuth consumer key to use to form the Authorization header.</param>
 /// <param name="consumerSecret">The OAuth consumer secret to use to form the Authorization header.</param>
 /// <param name="result">The LISResult to be updated within the server.</param>
 /// <returns>No content is returned.</returns>
 public static async Task <ClientResponse> PutResultAsync(HttpClient client, string serviceUrl, string consumerKey, string consumerSecret, Result result)
 {
     return(await PutOutcomeAsync(client, serviceUrl, consumerKey, consumerSecret, result, LtiConstants.LisResultMediaType));
 }