NSURLConnectionFilterMBS events

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSURLConnectionFilterMBS class.

NSURLConnectionFilterMBS.FilterConnection(request as NSURLRequestMBS) as NSURLRequestMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Networking MBS MacBase Plugin 18.2 ✅ Yes ❌ No ❌ No ❌ No
The event called when a new connection is made.
Example
Function FilterConnection(request as NSURLRequestMBS) Handles FilterConnection as NSURLRequestMBS
system.debuglog CurrentMethodName
system.debuglog "URL: "+request.URL

dim newRequest as NSMutableURLRequestMBS = request.mutableCopy

// change to 10 minutes
newRequest.setTimeoutInterval 600

return newRequest
End Function

You get the current request and you can return a new request.
If you return nil, we pass through the existing one.
Only requests on main thread trigger the event.

Some examples using this event:

The items on this page are in the following plugins: MBS MacBase Plugin.


💬 Ask a question or report a problem