public Task<Result> Remove(Firebase reference) { CheckDisposed(); ArgUtils.CheckForNull(reference, nameof(reference)); var request = new Request(reference, HttpMethod.Delete); return PerformRequest(request); }
public Task<Result> Set(Firebase reference, object content) { CheckDisposed(); ArgUtils.CheckForNull(reference, nameof(reference)); ArgUtils.CheckForNull(content, nameof(content)); var request = new Request(reference, HttpMethod.Put, content); return PerformRequest(request); }
private async Task<Result> PerformRequest(Request request) { try { HttpRequestMessage requestMessage = request.CreateRequestMessage(Context); HttpResponseMessage httpResponseMessage = await SendRequestMessage(requestMessage); return request.CreateResult(httpResponseMessage, Context); } catch (Exception ex) { return new Result(new FirebaseException(ex.Message, ex)); } }