Class: NSURLRequest
Overview
NSURLRequest objects represent a URL load request in a manner independent of protocol and URL scheme.
Direct Known Subclasses
Class Method Summary (collapse)
-
+ requestWithURL:
Creates and returns a URL request for a specified URL with default cache policy and timeout value.
-
+ requestWithURL:cachePolicy:timeoutInterval:
Creates and returns an initialized URL request with specified values.
Instance Method Summary (collapse)
-
- allHTTPHeaderFields
Returns a dictionary containing all the receiver’s HTTP header fields.
-
- allowsCellularAccess
Returns whether the request is allowed to use the cellular radio (if present).
-
- cachePolicy
Returns the receiver’s cache policy.
-
- HTTPBody
Returns the receiver’s HTTP body data.
-
- HTTPBodyStream
Returns the receiver’s HTTP body stream.
-
- HTTPMethod
Returns the receiver’s HTTP request method.
-
- HTTPShouldHandleCookies
Returns whether the default cookie handling will be used for this request.
-
- HTTPShouldUsePipelining
Returns whether the request should continue transmitting data before receiving a response from an earlier transmission.
-
- initWithURL:
Returns a URL request for a specified URL with default cache policy and timeout value.
-
- initWithURL:cachePolicy:timeoutInterval:
Returns an initialized URL request with specified values.
-
- mainDocumentURL
Returns the main document URL associated with the request.
-
- networkServiceType
Returns the network service type of the request.
-
- timeoutInterval
Returns the receiver’s timeout interval, in seconds.
-
- URL
Returns the request's URL.
-
- valueForHTTPHeaderField:
Returns the value of the specified HTTP header field.
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
Class Method Details
+ (Object) requestWithURL(theURL)
Creates and returns a URL request for a specified URL with default cache policy and timeout value. The default cache policy is NSURLRequestUseProtocolCachePolicy and the default timeout interval is 60 seconds.
+ (Object) requestWithURL(theURL, cachePolicy:cachePolicy, timeoutInterval:timeoutInterval)
Creates and returns an initialized URL request with specified values.
Instance Method Details
- (Hash) allHTTPHeaderFields
Returns a dictionary containing all the receiver’s HTTP header fields.
- (Boolean) allowsCellularAccess
Returns whether the request is allowed to use the cellular radio (if present).
- (NSURLRequestCachePolicy) cachePolicy
Returns the receiver’s cache policy.
- (NSData) HTTPBody
Returns the receiver’s HTTP body data. This data is sent as the message body of a request, as in an HTTP POST request.
- (NSInputStream) HTTPBodyStream
Returns the receiver’s HTTP body stream. The receiver will have either an HTTP body or an HTTP body stream, only one may be set for a request. A HTTP body stream is preserved when copying an NSURLRequest object, but is lost when a request is archived using the NSCoding protocol.
- (String) HTTPMethod
Returns the receiver’s HTTP request method. The default HTTP method is “GET”.
- (Boolean) HTTPShouldHandleCookies
Returns whether the default cookie handling will be used for this request. The default is YES.
- (Boolean) HTTPShouldUsePipelining
Returns whether the request should continue transmitting data before receiving a response from an earlier transmission.
- (Object) initWithURL(theURL)
Returns a URL request for a specified URL with default cache policy and timeout value. The default cache policy is NSURLRequestUseProtocolCachePolicy and the default timeout interval is 60 seconds.
- (Object) initWithURL(theURL, cachePolicy:cachePolicy, timeoutInterval:timeoutInterval)
Returns an initialized URL request with specified values. This is the designated initializer for NSURLRequest.
- (NSURL) mainDocumentURL
Returns the main document URL associated with the request. This URL is used for the cookie “same domain as main document” policy.
- (NSURLRequestNetworkServiceType) networkServiceType
Returns the network service type of the request.
- (NSTimeInterval) timeoutInterval
Returns the receiver’s timeout interval, in seconds. If during a connection attempt the request remains idle for longer than the timeout interval, the request is considered to have timed out.
- (NSURL) URL
Returns the request's URL.
- (String) valueForHTTPHeaderField(field)
Returns the value of the specified HTTP header field.