Xojo Conferences
XDCApr2018DenverUSA
MBSSep2018MunichEurope

MBS Xojo Network Kit

NSURLRequestMB class:

Class NSURLRequestMB
ComputedProperty HTTPBody As MemoryBlock
Sub Set() End
Sub Get() // Returns the request body data of the receiver. // This data is sent as the message body of the request, as in done in an HTTP POST request. // The request body data of the receiver. End
End ComputedProperty
ComputedProperty HTTPMethod As text
Sub Set() End
Sub Get() // Returns the HTTP request method of the receiver. End
End ComputedProperty
ComputedProperty HTTPShouldHandleCookies As Boolean
Sub Set() End
Sub Get() // Decide whether default cookie handling will happen for this request. // True if cookies should be sent with and set for this request; otherwise false. // The default is true - in other words, cookies are sent from and // stored to the cookie manager by default. End
End ComputedProperty
ComputedProperty HTTPShouldUsePipelining As Boolean
Sub Set() End
Sub Get() // Reports whether the receiver is not expected to wait for the // previous response before transmitting. // True if the receiver should transmit before the previous response // is received. False if the receiver should wait for the previous response // before transmitting. // Available on Mac OS X 10.7 and iOS 4.0 End
End ComputedProperty
ComputedProperty TimeoutInterval As double
Sub Set() End
Sub Get() // get timeout in seconds End
End ComputedProperty
ComputedProperty URL As text
Sub Set() End
Sub Get() // Returns the URL of the receiver. End
End ComputedProperty
ComputedProperty allHTTPHeaderFields As Dictionary
Sub Set() End
Sub Get() // Queries the HTTP header fields of the receiver to the given dictionary. // This method replaces all header fields that may have existed before this method call. // Since HTTP header fields must be string values, each object and // key in the dictionary passed to this method must be text. If either // the key or value for a key-value pair is not text when sent this // message, the key-value pair is skipped. End
End ComputedProperty
ComputedProperty allowsCellularAccess As Boolean
Sub Set() End
Sub Get() // returns whether a connection created with this request is allowed to use // the built in cellular radios (if present). // True if the receiver is allowed to use the built in cellular radios to // satify the request, false otherwise. End
End ComputedProperty
ComputedProperty cachePolicy As NSURLRequestCachePolicy
Sub Set() End
Sub Get() // Returns the cache policy of the receiver. End
End ComputedProperty
ComputedProperty mainDocumentURL As text
Sub Set() End
Sub Get() // The main document URL associated with this load. // This URL is used for the cookie "same domain as main document" policy. There may also be other future uses. // See setting MainDocumentURL // In the current implementation, this value is unused by the // framework. A fully functional version of this method will be available // in the future. End
End ComputedProperty
ComputedProperty networkServiceType As NSURLRequestNetworkServiceType
Sub Set() End
Sub Get() // Returns the NSURLRequestNetworkServiceType associated with this request. // This will return NSURLNetworkServiceTypeDefault for requests that have // not explicitly set a networkServiceType (using the NetworkServiceType setter). // The NSURLRequestNetworkServiceType associated with this request. End
End ComputedProperty
Const FoundationLib = Foundation.framework
Enum NSURLRequestCachePolicy NSURLRequestUseProtocolCachePolicy = 0 NSURLRequestReloadIgnoringLocalCacheData = 1 NSURLRequestReturnCacheDataElseLoad = 2 NSURLRequestReturnCacheDataDontLoad = 3 NSURLRequestReloadIgnoringCacheData = 1 End Enum
Enum NSURLRequestNetworkServiceType NSURLNetworkServiceTypeDefault = 0 NSURLNetworkServiceTypeVoIP = 1 NSURLNetworkServiceTypeVideo = 2 NSURLNetworkServiceTypeBackground = 3 NSURLNetworkServiceTypeVoice = 4 End Enum
Protected Sub Constructor() // private constructor End
Sub Constructor(Handle as Integer) End
Sub Constructor(URL as text) // Allocates and initializes an NSURLRequest with the given URL. // Default values are used for cache policy (NSURLRequestUseProtocolCachePolicy) and timeout interval (60 seconds). // URL: The URL for the request. End
Sub Constructor(URL as text, cachePolicy as NSURLRequestCachePolicy, timeoutInterval as Double) // Allocates and initializes a NSURLRequest with the given URL and cache policy. // URL: The URL for the request. // cachePolicy The cache policy for the request. // timeoutInterval: The timeout interval for the request. // See the commentary for the timeoutInterval for more information on timeout intervals. End
Sub Destructor() End
Shared Function Tests() As MemoryBlock // some tests if things work in general End
Function copy() As NSURLRequestMB // creates a copy of the request End
Function mutableCopy() As NSMutableURLRequestMB // Creates a mutable copy of this request End
Shared Sub testMessage(s as text) End
Function valueForHTTPHeaderField(field as text) As text // Returns the value which corresponds to the given header // field. Note that, in keeping with the HTTP RFC, HTTP header field // names are case-insensitive. // field the header field name to use for the lookup (case-insensitive). // the value associated with the given header field, or empty text if // there is no value associated with the given header field. End
Note About
Property Handle As Integer
End Class




Links
MBS Xojo tutorial videos