public void PutAsync(string path, object state, GithubAsyncCallback callback) { PutAsync(Version, path, state, callback); }
protected virtual void ApiAsync(GithubApiVersion version, string method, string path, object parameters, Type resultType, object state, GithubAsyncCallback callback) { if (!(version == GithubApiVersion.V2 || version == GithubApiVersion.V3)) throw new ArgumentOutOfRangeException("version", "Unknown version"); Stream responseStream = null; if (!method.Equals("HEAD", StringComparison.OrdinalIgnoreCase)) responseStream = new MemoryStream(); var request = PrepareRequest(version, method, path, parameters, responseStream); request.ExecuteAsync( ar => { Exception exception = ar.Exception; object result = null; if (exception == null) result = ProcessResponse(version, ar, responseStream, resultType, out exception); if (callback != null) { callback(new GithubAsyncResult(ar.IsCompleted, ar.AsyncWaitHandle, ar.CompletedSynchronously, ar.IsCancelled, result, ar.AsyncState, exception)); } }, state); }
public void PostAync(string path, IDictionary<string, object> parameters, object state, GithubAsyncCallback callback) { PostAsync(Version, path, parameters, state, callback); }
public void PutAsync(GithubApiVersion version, string path, object state, GithubAsyncCallback callback) { ApiAsync(version, "PUT", path, null, null, state, callback); }
public void PostAsync(GithubApiVersion version, string path, IList<object> parameters, object state, GithubAsyncCallback callback) { ApiAsync(version, "POST", path, parameters, null, state, callback); }
public void Post(string path, IList<object> parameters, object state, GithubAsyncCallback callback) { PostAsync(Version, path, parameters, state, callback); }
public void PatchAsync(GithubApiVersion version, string path, IDictionary<string, object> parameters, object state, GithubAsyncCallback callback) { ApiAsync(version, "PATCH", path, parameters, null, state, callback); }
public void HeadAsync(string path, object state, GithubAsyncCallback callback) { HeadAsync(path, null, state, callback); }
public void GetAync(GithubApiVersion version, string path, object state, GithubAsyncCallback callback) { GetAsync(version, path, null, state, callback); }