Platforms to show: All Mac Windows Linux Cross-Platform
NSURLRequestMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Cocoa Networking | MBS MacBase Plugin | 7.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Example:
msgbox HTMLViewer1.mainFrameMBS.DataSource.Request.url
NSURLRequest encapsulates two basic data elements about a URL load request:
The URL to load.
The policy to use when consulting the URL content cache made available by the implementation.
- 12 properties
- property attribution as Integer
- property cachePolicy as Integer
- property Handle as Integer
- property HTTPBody as memoryblock
- property HTTPMethod as string
- property HTTPShouldHandleCookies as boolean
- property HTTPShouldUsePipelining as boolean
- property isHTTPRequest as boolean
- property mainDocumentURL as string
- property networkServiceType as Integer
- property timeoutInterval as Double
- property URL as string
- 6 methods
- method allHTTPHeaderFields as Dictionary
- method Constructor(url as string)
- method Constructor(url as string, cachePolicy as Integer, timeoutInterval as Double)
- method copy as NSURLRequestMBS
- method mutableCopy as NSMutableURLRequestMBS
- method valueForHTTPHeaderField(field as string) as string
- 3 shared methods
- shared method requestWithHandle(Handle as Integer) as NSURLRequestMBS
- shared method requestWithURL(url as string) as NSURLRequestMBS
- shared method requestWithURL(url as string, cachePolicy as Integer, timeoutInterval as Double) as NSURLRequestMBS
- 13 constants
- const NSURLRequestReloadIgnoringCacheData = 1
- const NSURLRequestReloadIgnoringLocalAndRemoteCacheData = 4
- const NSURLRequestReloadRevalidatingCacheData = 5
- const NSURLRequestReturnCacheDataDontLoad = 3
- const NSURLRequestReturnCacheDataElseLoad = 2
- const NSURLRequestUseProtocolCachePolicy = 0
Network Service Type Constants
Constant | Value | Description |
---|---|---|
NSURLNetworkServiceTypeBackground | 3 |
Specifies that the request is for background traffic (such as a file download). The service type is used to provide the networking layers a hint of the purpose of the request. |
NSURLNetworkServiceTypeDefault | 0 |
Is the default value for an NSURLRequest when created. This value should be left unchanged for the vast majority of requests. The service type is used to provide the networking layers a hint of the purpose of the request. |
NSURLNetworkServiceTypeVideo | 2 |
Specifies that the request is for video traffic. The service type is used to provide the networking layers a hint of the purpose of the request. |
NSURLNetworkServiceTypeVoice | 4 |
Specifies that the request is for voice data. The service type is used to provide the networking layers a hint of the purpose of the request. |
NSURLNetworkServiceTypeVoIP | 1 |
Specifies that the request is for voice over IP control traffic. The service type is used to provide the networking layers a hint of the purpose of the request. |
Attribution
Constant | Value | Description |
---|---|---|
NSURLRequestAttributionDeveloper | 0 |
Indicates that the URL was specified by the developer. This is the default value for an NSURLRequest when created. |
NSURLRequestAttributionUser | 1 |
Indicates that the URL was specified by the user. |
Sub classes:
Some methods using this class:
- NSURLCacheMBS.removeCachedResponseForRequest(request as NSURLRequestMBS)
- NSURLConnectionMBS.canHandleRequest(request as NSURLRequestMBS) as boolean
- NSURLConnectionMBS.Constructor(request as NSURLRequestMBS, startImmediately as boolean)
- NSURLConnectionMBS.sendSynchronousRequest(request as NSURLRequestMBS, byref response as NSURLResponseMBS, byref error as NSErrorMBS) as Memoryblock
- NSURLSessionMBS.dataTaskWithRequest(request as NSURLRequestMBS) as NSURLSessionDataTaskMBS
- NSURLSessionMBS.uploadTaskWithRequest(request as NSURLRequestMBS, data as MemoryBlock, handler as NSURLSessionUploadTaskCompletedMBS, tag as Variant = nil) as NSURLSessionDataTaskMBS
- NSURLSessionMBS.uploadTaskWithRequest(request as NSURLRequestMBS, file as FolderItem, handler as NSURLSessionUploadTaskCompletedMBS, tag as Variant = nil) as NSURLSessionDataTaskMBS
- SLRequestMBS.preparedURLRequest as NSURLRequestMBS
- WebDataSourceMBS.request as NSURLRequestMBS
- WebViewMBS.LoadRequest(request as NSURLRequestMBS)
Some properties using for this class:
- NSURLSessionTaskMBS.currentRequest as NSURLRequestMBS
- NSURLSessionTaskMBS.originalRequest as NSURLRequestMBS
- NSURLSessionTaskTransactionMetricsMBS.request as NSURLRequestMBS
- WKDownloadMBS.originalRequest as NSURLRequestMBS
- WKFrameInfoMBS.request as NSURLRequestMBS
- WKNavigationActionMBS.request as NSURLRequestMBS
- WKNavigationMBS.request as NSURLRequestMBS
Some events using this class:
- NSURLConnectionFilterMBS.FilterConnection(request as NSURLRequestMBS) as NSURLRequestMBS
- NSURLConnectionMBS.willSendRequest(request as NSURLRequestMBS, redirectResponse as NSURLResponseMBS) as NSURLRequestMBS
- NSURLDownloadMBS.willSendRequest(request as NSURLRequestMBS, redirectResponse as NSURLResponseMBS) as NSURLRequestMBS
- NSURLSessionMBS.taskWillPerformHTTPRedirection(task as NSURLSessionTaskMBS, response as NSURLResponseMBS, request as NSURLRequestMBS) as NSURLRequestMBS
- WebPolicyDelegateMBS.decidePolicyForMIMEType(type as string,request as NSURLRequestMBS, frame as WebFrameMBS, decisionListener as WebPolicyDecisionListenerMBS) as boolean
- WebResourceLoadDelegateMBS.identifierForInitialRequest(request as NSURLRequestMBS, dataSource as WebDataSourceMBS) as Variant
- WebResourceLoadDelegateMBS.willSendRequest(id as Variant, request as NSURLRequestMBS, redirectResponse as NSURLResponseMBS, dataSource as WebDataSourceMBS) as NSURLRequestMBS
- WKWebViewControlMBS.CreateWebView(URL as String, request as NSURLRequestMBS) as Variant
- WKWebViewControlMBS.downloadWillPerformHTTPRedirection(download as WKDownloadMBS, response as NSURLResponseMBS, request as NSURLRequestMBS, byref DownloadRedirectPolicy as Integer)
- WKWebViewIOSControlMBS.downloadWillPerformHTTPRedirection(download as WKDownloadMBS, response as NSURLResponseMBS, request as NSURLRequestMBS, byref DownloadRedirectPolicy as Integer)
Some examples using this class:
- /MacBase/NSURLConnection test
- /MacBase/NSURLDownload/NSURLDownload Example
- /MacBase/NSURLDownload/NSURLDownload test
- /MacCocoa/NSURLConnection test
- /MacCocoa/NSURLConnectionFilter test
- /MacControls/WebUIDelegate
- /MacFrameworks/Cocoa Controls/WebView with Delegate
- /MacFrameworks/NSURLSession Test
Blog Entries
- MonkeyBread Software Releases the MBS Xojo Plugins in version 21.5
- MBS Xojo Plugins, version 21.5pr4
- MBS Releases the MBS Xojo / Real Studio plug-ins in version 16.4
- MBS Xojo / Real Studio Plugins, version 16.4pr4
- Notes from the last days
- MBS Real Studio Plugins, version 11.3pr6
Xojo Developer Magazine
The items on this page are in the following plugins: MBS MacBase Plugin.
NSURLRequestCertificateFilterMBS - NSURLResponseMBS
Feedback: Report problem or ask question.
