示例#1
0
 /// <summary>
 /// Performs an async request using a <b>DELETE</b> method.
 /// </summary>
 /// <param name="endpoint">URL to which will be sent to request.</param>
 /// <param name="parameters">Parameters to be passed to request.</param>
 /// <param name="authorization">Authorization header value.</param>
 /// <param name="headers">HTTP headers for request.</param>
 /// <param name="callback">A delegate that, if provided, is called when an async request is completed.</param>
 /// <param name="accessToken">Access token to be used in the request.</param>
 /// <remarks>
 /// <para>Can not be used simultaneously <paramref name="accessToken"/> and <paramref name="authorization"/>. Use only one of these parameters.</para>
 /// </remarks>
 /// <returns>Returns an instance of the <see cref="RequestResult"/> class, which contains the result of the request.</returns>
 /// <exception cref="System.ArgumentNullException"></exception>
 /// <exception cref="RequestException"></exception>
 /// <exception cref="ArgumentException">
 /// <para>The exception occurs when the query parameters are specified at the same time <paramref name="authorization"/> and <paramref name="accessToken"/>.</para>
 /// </exception>
 public static void DeleteAsync(string endpoint = null, HttpParameterCollection parameters = null, HttpAuthorization authorization = null, NameValueCollection headers = null, AccessToken accessToken = null, ExecuteRequestAsyncCallback callback = null)
 {
     OAuthUtility.ExecuteRequestAsync("DELETE", endpoint, parameters, authorization, headers, null, accessToken, callback);
 }
示例#2
0
 /// <summary>
 /// Performs an async request using a <b>PUT</b> method.
 /// </summary>
 /// <param name="endpoint">URL to which will be sent to request.</param>
 /// <param name="parameters">Parameters to be passed to request.</param>
 /// <param name="authorization">Authorization header value.</param>
 /// <param name="headers">HTTP headers for request.</param>
 /// <param name="contentType">The value of the <b>Content-Type</b> HTTP header.</param>
 /// <param name="callback">A delegate that, if provided, is called when an async request is completed.</param>
 /// <param name="accessToken">Access token to be used in the request.</param>
 /// <remarks>
 /// <para>Can not be used simultaneously <paramref name="accessToken"/> and <paramref name="authorization"/>. Use only one of these parameters.</para>
 /// </remarks>
 /// <returns>Returns an instance of the <see cref="RequestResult"/> class, which contains the result of the request.</returns>
 /// <exception cref="System.ArgumentNullException"></exception>
 /// <exception cref="RequestException"></exception>
 /// <exception cref="ArgumentException">
 /// <para>The exception occurs when the query parameters are specified at the same time <paramref name="authorization"/> and <paramref name="accessToken"/>.</para>
 /// </exception>
 public static void PutAsync(string endpoint = null, HttpParameterCollection parameters = null, HttpAuthorization authorization = null, NameValueCollection headers = null, string contentType = null, AccessToken accessToken = null, ExecuteRequestAsyncCallback callback = null)
 {
     OAuthUtility.ExecuteRequestAsync("PUT", endpoint, parameters, authorization, headers, contentType, accessToken, callback);
 }