WklHttpRequests
WklHttpRequests class
Signature
Dim myWklHttpRequests As WklHttpRequests
Summary
The requests of a web request queue; For Each walks them by Id.
Parameters
None
Remarks
Not created directly; returned by other members of the library.
| Member | Kind | Summary |
|---|---|---|
| `Item` | Property | Gets a request by Id. |
| `Count` | Property | Gets the number of requests kept, done ones too. |
| `Waiting` | Property | Gets the number of requests not yet sent. |
| `Add` | Method | Adds a request at the end of the queue. |
| `Clear` | Method | Cancels every request not yet done; each raises RequestCancelled. |
| `Forget` | Method | Removes done requests from the collection. |
Code example
None
Inheritance
None
Item property
Signature
Property Get Item(ByVal Id As Long) As WklHttpRequest
Summary
Gets a request by Id.
Parameters
| Name | Type | Optional | Default | Description |
|---|---|---|---|---|
Id | Long | No | – | The Id. |
Property value: `WklHttpRequest` – The request.
Remarks
Default member: it can be left out, as in myWklHttpRequests(...) for myWklHttpRequests.Item(...). Read-only.
Code example
None
Inheritance
Declared by WklHttpRequests.
Count property
Signature
Property Get Count() As Long
Summary
Gets the number of requests kept, done ones too.
Parameters
None
Property value: Long – The number.
Remarks
Read-only.
Code example
None
Inheritance
Declared by WklHttpRequests.
Waiting property
Signature
Property Get Waiting() As Long
Summary
Gets the number of requests not yet sent.
Parameters
None
Property value: Long – The number.
Remarks
Read-only.
Code example
None
Inheritance
Declared by WklHttpRequests.
Add method
Signature
Function Add(ByVal Method As String, ByVal Url As String, Optional ByVal Body As String = "", Optional ByVal Tag As Variant, Optional ByVal ContentType As String = "") As WklHttpRequest
Summary
Adds a request at the end of the queue.
Parameters
| Name | Type | Optional | Default | Description |
|---|---|---|---|---|
Method | String | No | – | GET, POST, PUT, PATCH, DELETE … |
Url | String | No | – | The address. |
Body | String | Yes | "" | The body, sent as UTF-8. |
Tag | Variant | Yes | – | Any value, passed to every event of the request. |
ContentType | String | Yes | "" | The Content-Type of the body (default application/json; charset=utf-8). |
Return value: `WklHttpRequest` – The new request.
Remarks
A started queue that ran empty starts a new run. The request gets a new GUID as Idempotency-Key.
Code example
None
Inheritance
Declared by WklHttpRequests.
Clear method
Signature
Sub Clear()
Summary
Cancels every request not yet done; each raises RequestCancelled.
Parameters
None
Remarks
None
Code example
None
Inheritance
Declared by WklHttpRequests.
Forget method
Signature
Function Forget() As Long
Summary
Removes done requests from the collection.
Parameters
None
Return value: Long – The number removed.
Remarks
Keeps a long import from holding every row.
Code example
None
Inheritance
Declared by WklHttpRequests.