public void Execute(Action <GetTagsResponse> responseCallback, Action <Exception> exceptionCallback) { var request = RequestBuilder.Build("https://go.urbanairship.com/api/tags/"); request.Method = "GET"; request.ContentType = "application/json"; var asyncRequest = new AsyncRequest { ReadFromResponse = stream => responseCallback(new GetTagsResponse { Tags = TagDeSerializer.DeSerialize(stream).ToList() }), Request = request, ExceptionCallback = exceptionCallback, }; asyncRequest.Execute(); }
public void Execute(GetTagsForDeviceRequest request, Action <GetTagsForDeviceResponse> responseCallback, Action <Exception> exceptionCallback) { var webRequest = RequestBuilder.Build(string.Format("https://go.urbanairship.com/api/device_tokens/{0}/tags/", request.DeviceToken)); webRequest.Method = "GET"; webRequest.ContentType = "application/json"; var asyncRequest = new AsyncRequest { ReadFromResponse = stream => responseCallback(new GetTagsForDeviceResponse { Tags = TagDeSerializer.DeSerialize(stream).ToList() }), Request = webRequest, ExceptionCallback = exceptionCallback, }; asyncRequest.Execute(); }