-
Notifications
You must be signed in to change notification settings - Fork 1
DuckSharpClient Documentation
TheMulti0 edited this page Nov 10, 2018
·
3 revisions
In this page we are going to go through the public methods of DuckSharpClient.
The constructor of the client has 3 optional parameters:
-
string applicationName: 'DuckSharp'- The application name that will refer to the API (it is set to'DuckSharp'by default).
-
bool allowHtml: true- The boolean that indicates whether the response will include HTML in text, for example; bold and italics (it is set totrueby default).
-
bool allowDisambiguation: true- The boolean that indicates whether the response will include disambiguation answer results. It is set totrueby default.
Returns: void
The client implements the interface IDisposable, meaning it can be disposed (and used in using statements).
Returns: Task<InstantAnswer>
The method GetInstantAnswerAsync requires a parameter:
-
string query- This is the string value that will be searched andInstantAnswerwill be found with. However it does have another optional parameter: -
CancellationTokentoken: default- The optional cancellation token that can be used to cancel the task (async operation) while it runs (It is set to an emptyCancellationTokenby default).
Returns: Task<string>
The method GetInstantAnswerAsync requires a parameter:
-
string query- This is the source the link will redirect to and the query it will give the source. However it does have another optional parameter: -
CancellationTokentoken: default- The optional cancellation token that can be used to cancel the task (async operation) while it runs (It is set to an emptyCancellationTokenby default).