From 7769ad7c8540a5c13bbf388d12d2e9d699bc0bb7 Mon Sep 17 00:00:00 2001 From: Ben Yarbro <50184801+BenYarbro@users.noreply.github.com> Date: Wed, 30 Oct 2019 13:25:12 -0700 Subject: [PATCH] Update to SearchAPIRequest.cs I am submit this recommended change on behalf of Clarke to included a graceful exit to a thread using a cancellation token. --- Piplapis/Search/SearchAPIRequest.cs | 32 ++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/Piplapis/Search/SearchAPIRequest.cs b/Piplapis/Search/SearchAPIRequest.cs index 4465eef..b5c6229 100644 --- a/Piplapis/Search/SearchAPIRequest.cs +++ b/Piplapis/Search/SearchAPIRequest.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Net; using Newtonsoft.Json; @@ -16,7 +16,9 @@ namespace Pipl.APIs.Search { - /** + using System.Threading; + + /** * A request to Pipl's Search API. *
* Sending the request and getting the response is very simple and can be done @@ -326,20 +328,22 @@ public SearchAPIResponse Send(bool strictValidation = true) * Send the request and return the response or raise SearchAPIError. * * + * @param cancellationToken A CancellationToken to be used to cancel the operation. * @param strictValidation A bool argument that's passed to the * validateQueryParams method. * @return A task that runs the request asyncronously * @throws ArgumentException Raises ArgumentException (raised from validateQueryParams) * @throws IOException IOException */ - public Task