TaskStatus
Reads the supplied task’s download state and HTTP attempt history from the MSSQL-compatible API.
Syntax
wds.TaskStatus(@downloadTask)
Arguments
| Name | Type | Description |
|---|---|---|
| @downloadTask | wds.DownloadTask | Supplies the download task ID and server connection. A null task returns a null status; a task with an error returns that error without calling the server. |
Returns
wds.DownloadTaskStatus — a task-status object.
Data Contracts
DownloadTask
Represents a download task that can be passed to MSSQL CLR functions.
| Name | Type | Description |
|---|---|---|
| Server | ServerConfig | Server connection associated with the task. |
| Id | string | Download task identifier. |
| Url | string | Download task URL. |
Validation requires Server, Id, and Url.
ServerConfig
API server configuration.
| Name | Type | Description |
|---|---|---|
| Uri | Uri | API server URI. |
Parse accepts wds://user:password@host:port?https=false, requires the wds scheme, and produces an HTTP URI unless https=true is supplied. Validation requires a URI.
DownloadTaskStatus
Reports the current state and request history for a download task.
| Name | Type | Description |
|---|---|---|
| Url | string | Downloaded URL. |
| TaskState | string | String wrapper for State; it is excluded from XML serialization. |
| State | DownloadTaskStates | Task state. |
| Result | DownloadInfo or null | Optional final download-attempt details. |
| IntermedResults | array of DownloadInfo or null | Optional earlier attempt details, such as redirects or proxy retries. |
DownloadTaskStates
Defines the lifecycle state reported for a download task.
| Name | Description |
|---|---|
| Handled | The downloader finished the task; inspect Result.IsSuccess and Result.HttpStatusCode when a result is present. |
| AccessDeniedForRobots | Access to the URL is denied by robots.txt. |
| AllRequestGatesExhausted | All request gateways were exhausted without receiving data. |
| Created | Task has not started. |
| InProgress | Task is in progress. |
| Deleted | Task has been deleted. |
DownloadInfo
Download attempt information.
| Name | Type | Description |
|---|---|---|
| Method | string | HTTP method. |
| Url | string | Request URL. |
| IsSuccess | bool | Indicates whether the request succeeded. |
| HttpStatusCode | int | HTTP status code. |
| ReasonPhrase | string | HTTP reason phrase. |
| RequestHeaders | array of HttpHeader | HTTP headers sent with the request. |
| ResponseHeaders | array of HttpHeader | HTTP headers received in the response. |
| RequestCookies | array of Cookie | Cookies sent with the request. |
| ResponseCookies | array of Cookie | Cookies received in the response. |
| RequestDateUtc | DateTime | Request date and time in UTC. |
| DownloadTimeSec | double | Download time in seconds. |
| ViaProxy | bool | Indicates whether the request was made through a proxy. |
| WaitTimeSec | double | Delay in seconds before the request was executed. |
| CrawlDelaySec | int | Delay in seconds applied to the request. |
Validation requires Method and Url.
HttpHeader
HTTP header.
| Name | Type | Description |
|---|---|---|
| Name | string | Header name. |
| Values | array of string | Header values. |
Parse accepts Name: name; Values: value1, value2;. Validation requires both fields.
Cookie
Represents an HTTP cookie observed during a download request or response.
| Name | Type | Description |
|---|---|---|
| Name | string | Cookie name. |
| Value | string or null | Optional cookie value. |
| Domain | string or null | Optional cookie domain attribute. |
| Path | string or null | Optional cookie path attribute. |
| HttpOnly | bool | HttpOnly cookie attribute. |
| Secure | bool | Secure cookie attribute. |
| Expires | DateTime or null | Optional expiration date and time; null for a session cookie or an unknown expiration. |
Validation requires Name.