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 |
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
Constants
Constant | Value | Description |
---|---|---|
NSURLRequestReloadIgnoringCacheData | 1 | A constant that can be used to specify the type of interactions that take place with the caching system when the URL loading system processes a request. Specifically, these constants cover interactions that have to do with whether already-existing cache data is returned to satisfy a URL load request. more |
NSURLRequestReloadIgnoringLocalAndRemoteCacheData | 4 | A constant that can be used to specify the type of interactions that take place with the caching system when the URL loading system processes a request. Specifies that not only should the local cache data be ignored, but that proxies and other intermediates should be instructed to disregard their caches so far as the protocol allows. more |
NSURLRequestReloadRevalidatingCacheData | 5 |
A constant that can be used to specify the type of interactions that take place with the caching system when the URL loading system processes a request.
Specifies that the existing cache data may be used provided the origin source confirms its validity, otherwise the URL is loaded from the origin source. Available in Mac OS X v10.5 and later. |
NSURLRequestReturnCacheDataDontLoad | 3 | A constant that can be used to specify the type of interactions that take place with the caching system when the URL loading system processes a request. Specifically, these constants cover interactions that have to do with whether already-existing cache data is returned to satisfy a URL load request. more |
NSURLRequestReturnCacheDataElseLoad | 2 | A constant that can be used to specify the type of interactions that take place with the caching system when the URL loading system processes a request. Specifically, these constants cover interactions that have to do with whether already-existing cache data is returned to satisfy a URL load request. more |
NSURLRequestUseProtocolCachePolicy | 0 | A constant that can be used to specify the type of interactions that take place with the caching system when the URL loading system processes a request. Specifically, these constants cover interactions that have to do with whether already-existing cache data is returned to satisfy a URL load request. more |
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. more |
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:
- DesktopWKWebViewControlMBS.LoadURLRequest(Request as NSURLRequestMBS)
- NSURLCacheMBS.storeCachedResponse(cachedResponse as NSCachedURLResponseMBS, request as NSURLRequestMBS)
- NSURLConnectionMBS.sendSynchronousRequest(request as NSURLRequestMBS, byref response as NSURLResponseMBS, byref error as NSErrorMBS) as Memoryblock
- NSURLSessionMBS.downloadTaskWithRequest(request as NSURLRequestMBS) as NSURLSessionDownloadTaskMBS
- NSURLSessionMBS.downloadTaskWithRequest(request as NSURLRequestMBS, handler as NSURLSessionUploadTaskCompletedMBS, tag as Variant = nil) as NSURLSessionDataTaskMBS
- NSURLSessionMBS.uploadTaskWithRequest(request as NSURLRequestMBS, data as MemoryBlock) as NSURLSessionUploadTaskMBS
- NSURLSessionMBS.uploadTaskWithRequest(request as NSURLRequestMBS, data as MemoryBlock, handler as NSURLSessionUploadTaskCompletedMBS, tag as Variant = nil) as NSURLSessionDataTaskMBS
- SLRequestMBS.preparedURLRequest as NSURLRequestMBS
- WKWebViewControlMBS.LoadURLRequest(Request as NSURLRequestMBS)
- WKWebViewIOSControlMBS.LoadURLRequest(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:
- DesktopWKWebViewControlMBS.CreateWebView(URL as String, request as NSURLRequestMBS) as Variant
- DesktopWKWebViewControlMBS.downloadWillPerformHTTPRedirection(download as WKDownloadMBS, response as NSURLResponseMBS, request as NSURLRequestMBS, byref DownloadRedirectPolicy as Integer)
- 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
- 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.CreateWebView(URL as String, request as NSURLRequestMBS) as WKWebViewIOSControlMBS
- 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
- /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
Release notes
- Version 21.5
- Added attribution property for NSURLRequestMBS class.
- Upgraded NSURLRequestMBS to show properties in debugger.
The items on this page are in the following plugins: MBS MacBase Plugin.
NSURLRequestCertificateFilterMBS - NSURLResponseMBS