Class: NSMutableURLRequest
- Inherits:
-
NSURLRequest
- Object
- NSObject
- NSURLRequest
- NSMutableURLRequest
Overview
NSMutableURLRequest is a subclass of NSURLRequest provided to aid developers who may find it more convenient to mutate a single request object for a series of URL load requests instead of creating an immutable NSURLRequest for each load.
Instance Method Summary (collapse)
-
- addValue:forHTTPHeaderField:
Adds an HTTP header to the receiver’s HTTP header dictionary.
-
- setAllHTTPHeaderFields:
Replaces the receiver's header fields with the passed values.
-
- setAllowsCellularAccess:
Sets whether the connection can use the device’s cellular radio (if present).
-
- setCachePolicy:
Sets the cache policy of the receiver.
-
- setHTTPBody:
Sets the request body of the receiver to the specified data.
-
- setHTTPBodyStream:
Sets the request body of the receiver to the contents of a specified input stream.
-
- setHTTPMethod:
Sets the receiver’s HTTP request method.
-
- setHTTPShouldHandleCookies:
Sets whether the receiver should use the default cookie handling for the request.
-
- setHTTPShouldUsePipelining:
Sets whether the request can continue transmitting data before receiving a response from an earlier transmission.
-
- setMainDocumentURL:
Sets the main document URL for the receiver.
-
- setNetworkServiceType:
Sets the network service type of the connection.
-
- setTimeoutInterval:
Sets the receiver’s timeout interval, in seconds.
-
- setURL:
Sets the URL of the receiver.
-
- setValue:forHTTPHeaderField:
Sets the specified HTTP header field.
Methods inherited from NSURLRequest
#HTTPBody, #HTTPBodyStream, #HTTPMethod, #HTTPShouldHandleCookies, #HTTPShouldUsePipelining, #URL, #allHTTPHeaderFields, #allowsCellularAccess, #cachePolicy, #initWithURL:, #initWithURL:cachePolicy:timeoutInterval:, #mainDocumentURL, #networkServiceType, requestWithURL:, requestWithURL:cachePolicy:timeoutInterval:, #timeoutInterval, #valueForHTTPHeaderField:
Methods inherited from NSObject
#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, #init, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version
Constructor Details
This class inherits a constructor from NSObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class NSObject
Instance Method Details
- (Object) addValue(value, forHTTPHeaderField:field)
Adds an HTTP header to the receiver’s HTTP header dictionary. This method provides the ability to add values to header fields incrementally. If a value was previously set for the specified field, the supplied value is appended to the existing value using the appropriate field delimiter. In the case of HTTP, this is a comma.
- (Object) setAllHTTPHeaderFields(headerFields)
Replaces the receiver's header fields with the passed values.
- (Object) setAllowsCellularAccess(allow)
Sets whether the connection can use the device’s cellular radio (if present). The default is YES.
- (Object) setCachePolicy(policy)
Sets the cache policy of the receiver.
- (Object) setHTTPBody(data)
Sets the request body of the receiver to the specified data. Setting the HTTP body data clears any input stream set by setHTTPBodyStream:. These values are mutually exclusive.
- (Object) setHTTPBodyStream(inputStream)
Sets the request body of the receiver to the contents of a specified input stream. Setting a body stream clears any data set by setHTTPBody:. These values are mutually exclusive.
- (Object) setHTTPMethod(method)
Sets the receiver’s HTTP request method.
- (Object) setHTTPShouldHandleCookies(handleCookies)
Sets whether the receiver should use the default cookie handling for the request.
- (Object) setHTTPShouldUsePipelining(shouldUsePipelining)
Sets whether the request can continue transmitting data before receiving a response from an earlier transmission. Specifying YES does not guarantee HTTP pipelining behavior, because some servers do not support pipelining.
- (Object) setMainDocumentURL(theURL)
Sets the main document URL for the receiver. The caller should set the main document URL to an appropriate main document, if known. For example, when loading a web page the URL of the HTML document for the top-level frame would be appropriate. This URL will be used for the “only from same domain as main document” cookie accept policy.
- (Object) setNetworkServiceType(networkServiceType)
Sets the network service type of the connection.
- (Object) setTimeoutInterval(timeoutInterval)
Sets the receiver’s timeout interval, in seconds.
- (Object) setURL(theURL)
Sets the URL of the receiver
- (Object) setValue(value, forHTTPHeaderField:field)
Sets the specified HTTP header field.