/// <summary> /// Saves the given response to the given file path. /// Disposes the response after saving has finished. /// </summary> /// <param name="response">The response to use.</param> /// <param name="filePath">The path where the response should be saved.</param> /// <returns>The task storing the file.</returns> public static async Task SaveToAsync(this IResponse response, String filePath) { using (var target = File.OpenWrite(filePath)) { await response.CopyToAsync(target).ConfigureAwait(false); } }