MBS Xojo Network Kit
NSMutableURLRequestMB class:
Class NSMutableURLRequestMB Inherits NSURLRequestMB
ComputedProperty HTTPBody As MemoryBlock
Sub Set()
// Sets 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.
// Value: the new request body data for the receiver.
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()
// Sets the HTTP request method of the receiver.
End
Sub Get()
// Returns the HTTP request method of the receiver.
End
End ComputedProperty
ComputedProperty HTTPShouldHandleCookies As Boolean
Sub Set()
// 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
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()
// Sets whether the request should not wait for the previous response
// before transmitting.
// True if the receiver should transmit before the previous response is
// received. False to wait for the previous response before transmitting.
// Calling this method with a true value does not guarantee HTTP
// pipelining behavior. This method may have no effect if an HTTP proxy is
// configured, or if the HTTP request uses an unsafe request method (e.g., POST
// requests will not pipeline). Pipelining behavior also may not begin until
// the second request on a given TCP connection. There may be other situations
// where pipelining does not occur even though YES was set.
// HTTP 1.1 allows the client to send multiple requests to the server without
// waiting for a response. Though HTTP 1.1 requires support for pipelining,
// some servers report themselves as being HTTP 1.1 but do not support
// pipelining (disconnecting, sending resources misordered, omitting part of
// a resource, etc.).
// Available on Mac OS X 10.7 and iOS 4.0
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()
// Sets the timeout interval of the receiver.
// The timeout interval specifies the limit on the idle
// interval allotted to a request in the process of loading. The "idle
// interval" is defined as the period of time that has passed since the
// last instance of load activity occurred for a request that is in the
// process of loading. Hence, when an instance of load activity occurs
// (e.g. bytes are received from the network for a request), the idle
// interval for a request is reset to 0. If the idle interval ever
// becomes greater than or equal to the timeout interval, the request
// is considered to have timed out. This timeout interval is measured
// in seconds.
// value: The new timeout interval in seconds of the receiver.
End
Sub Get()
// get timeout in seconds
End
End ComputedProperty
ComputedProperty URL As text
Sub Set()
// Sets the URL of the receiver.
End
Sub Get()
// Returns the URL of the receiver.
End
End ComputedProperty
ComputedProperty allHTTPHeaderFields As Dictionary
Sub Set()
// Sets 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.
// value: a dictionary containing HTTP header fields.
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()
// sets whether a connection created with this request is allowed to use
// the built in cellular radios (if present).
// allow false if the receiver should not be allowed to use the built in
// cellular radios to satisfy the request, true otherwise. The default is true.
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()
// sets the cache policy of the receiver.
End
Sub Get()
// Returns the cache policy of the receiver.
End
End ComputedProperty
ComputedProperty mainDocumentURL As text
Sub Set()
// Sets the main document URL
// URL The main document URL.
// The caller should pass the URL for an appropriate main
// document, if known. For example, when loading a web page, the URL
// of the main html document for the top-level frame should be
// passed. This main document will be used to implement the cookie
// "only from same domain as main document" policy, and possibly
// other things in the future.
// NOTE: In the current implementation, the passed-in value is unused by the
// framework. A fully functional version of this method will be available
// in the future.
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()
// Sets the NSURLRequestNetworkServiceType to associate with this request
// networkServiceType The NSURLRequestNetworkServiceType to associate with the request.
// This method is used to provide the network layers with a hint as to the purpose
// of the request. Most clients should not need to use this method.
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
Sub Constructor()
// create new empty request
End
Sub Constructor(theHandle as Integer)
// create request with given handle
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 ValueForHTTPHeaderField(field as text, assigns value as text)
// for assignment like this:
// x.ValueForHTTPHeaderField(Field) = value
// Sets the value of the given HTTP header field.
// If a value was previously set for the given header
// field, that value is replaced with the given value. Note that, in
// keeping with the HTTP RFC, HTTP header field names are
// case-insensitive.
// value the header field value.
// field the header field name (case-insensitive).
End
Sub addValueForHTTPHeaderField(field as text, value as text)
// Adds an HTTP header field in the current header dictionary.
// This method provides a way to add values to header
// fields incrementally. If a value was previously set for the given
// header field, the given value is appended to the previously-existing
// value. The appropriate field delimiter, a comma in the case of HTTP,
// is added by the implementation, and should not be added to the given
// value by the caller. Note that, in keeping with the HTTP RFC, HTTP
// header field names are case-insensitive.
// value the header field value.
// field the header field name (case-insensitive).
End
Sub setHTTPBodyWithFile(file as FolderItem)
// Sets the request body to be the contents of the given file.
// The entire file's contents will be transmitted as the HTTP body of the request.
// Note that the body stream and the body data (set by HTTPBody) are mutually exclusive
// setting one will clear the other.
End
Sub setHTTPBodyWithPath(Path as Text)
// Sets the request body to be the contents of the given file.
// The entire file's contents will be transmitted as the HTTP body of the request.
// Note that the body stream and the body data (set by HTTPBody) are mutually exclusive
// setting one will clear the other.
End
Sub setHTTPBodyWithURL(URL as text)
// Sets the request body to be the contents of the given file.
// The entire file's contents will be transmitted as the HTTP body of the request.
// Note that the body stream and the body data (set by HTTPBody) are mutually exclusive
// setting one will clear the other.
End
Sub setValueForHTTPHeaderField(field as text, value as text)
// Sets the value of the given HTTP header field.
// If a value was previously set for the given header
// field, that value is replaced with the given value. Note that, in
// keeping with the HTTP RFC, HTTP header field names are
// case-insensitive.
// value the header field value.
// field the header field name (case-insensitive).
End
Note About
End Class
Links
MBS Xojo PDF Plugins