Package apple.foundation
Class NSURLRequest
- java.lang.Object
-
- org.moe.natj.general.NativeObject
-
- org.moe.natj.objc.ObjCObject
-
- apple.NSObject
-
- apple.foundation.NSURLRequest
-
- All Implemented Interfaces:
NSCoding,NSCopying,NSMutableCopying,NSSecureCoding,NSObject
- Direct Known Subclasses:
NSMutableURLRequest
public class NSURLRequest extends NSObject implements NSSecureCoding, NSCopying, NSMutableCopying
NSURLRequest An NSURLRequest object represents a URL load request in a manner independent of protocol and URL scheme. 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.
- Protocol implementors should direct their attention to the NSURLRequestExtensibility category on NSURLRequest for more information on how to provide extensions on NSURLRequest to support protocol-specific request information.
- Clients of this API who wish to create NSURLRequest objects to load URL content should consult the protocol-specific NSURLRequest categories that are available. The NSHTTPURLRequest category on NSURLRequest is an example.
Objects of this class are used to create NSURLConnection instances, which can are used to perform the load of a URL, or as input to the NSURLConnection class method which performs synchronous loads.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class apple.NSObject
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedNSURLRequest(org.moe.natj.general.Pointer peer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean_supportsSecureCoding()This property must return YES on all classes that allow secure coding.static booleanaccessInstanceVariablesDirectly()NSDictionary<java.lang.String,java.lang.String>allHTTPHeaderFields()Returns a dictionary containing all the HTTP header fields of the receiver.static NSURLRequestalloc()static java.lang.ObjectallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)booleanallowsCellularAccess()returns whether a connection created with this request is allowed to use the built in cellular radios (if present).booleanallowsConstrainedNetworkAccess()returns whether a connection created with this request is allowed to use network interfaces which have been marked as constrained.booleanallowsExpensiveNetworkAccess()returns whether a connection created with this request is allowed to use network interfaces which have been marked as expensive.static booleanautomaticallyNotifiesObserversForKey(java.lang.String key)longcachePolicy()Returns the cache policy of the receiver.static voidcancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)static voidcancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)static NSArray<java.lang.String>classFallbacksForKeyedArchiver()static org.moe.natj.objc.ClassclassForKeyedUnarchiver()java.lang.ObjectcopyWithZone(org.moe.natj.general.ptr.VoidPtr zone)static java.lang.StringdebugDescription_static()static java.lang.Stringdescription_static()voidencodeWithCoder(NSCoder coder)static longhash_static()NSDataHTTPBody()Returns the request body data of the receiver.NSInputStreamHTTPBodyStream()Returns the request body stream of the receiver if any has been set The stream is returned for examination only; it is not safe for the caller to manipulate the stream in any way.java.lang.StringHTTPMethod()Returns the HTTP request method of the receiver.booleanHTTPShouldHandleCookies()Determine whether default cookie handling will happen for this request.booleanHTTPShouldUsePipelining()Reports whether the receiver is not expected to wait for the previous response before transmitting.NSURLRequestinit()NSURLRequestinitWithCoder(NSCoder coder)NS_DESIGNATED_INITIALIZERNSURLRequestinitWithURL(NSURL URL)initWithURL: Initializes an NSURLRequest with the given URL.NSURLRequestinitWithURLCachePolicyTimeoutInterval(NSURL URL, long cachePolicy, double timeoutInterval)initWithURL: Initializes an NSURLRequest with the given URL and cache policy.static NSObject.Function_instanceMethodForSelector_retinstanceMethodForSelector(org.moe.natj.objc.SEL aSelector)static NSMethodSignatureinstanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)static booleaninstancesRespondToSelector(org.moe.natj.objc.SEL aSelector)static booleanisSubclassOfClass(org.moe.natj.objc.Class aClass)static NSSet<java.lang.String>keyPathsForValuesAffectingValueForKey(java.lang.String key)NSURLmainDocumentURL()The main document URL associated with this load.java.lang.ObjectmutableCopyWithZone(org.moe.natj.general.ptr.VoidPtr zone)longnetworkServiceType()Returns the NSURLRequestNetworkServiceType associated with this request.static java.lang.Objectnew_objc()static NSURLRequestrequestWithURL(NSURL URL)requestWithURL: Allocates and initializes an NSURLRequest with the given URL.static NSURLRequestrequestWithURLCachePolicyTimeoutInterval(NSURL URL, long cachePolicy, double timeoutInterval)requestWithURL:cachePolicy:timeoutInterval: Allocates and initializes a NSURLRequest with the given URL and cache policy.static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)static voidsetVersion_static(long aVersion)static org.moe.natj.objc.Classsuperclass_static()static booleansupportsSecureCoding()doubletimeoutInterval()Returns the timeout interval of the receiver.NSURLURL()Returns the URL of the receiver.java.lang.StringvalueForHTTPHeaderField(java.lang.String field)valueForHTTPHeaderField: Returns the value which corresponds to the given header field.static longversion_static()-
Methods inherited from class apple.NSObject
accessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKey
-
-
-
-
Method Detail
-
accessInstanceVariablesDirectly
public static boolean accessInstanceVariablesDirectly()
-
alloc
public static NSURLRequest alloc()
-
allocWithZone
public static java.lang.Object allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
-
automaticallyNotifiesObserversForKey
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
-
cancelPreviousPerformRequestsWithTarget
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
-
cancelPreviousPerformRequestsWithTargetSelectorObject
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)
-
classFallbacksForKeyedArchiver
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
-
classForKeyedUnarchiver
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
-
debugDescription_static
public static java.lang.String debugDescription_static()
-
description_static
public static java.lang.String description_static()
-
hash_static
public static long hash_static()
-
instanceMethodForSelector
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
-
instanceMethodSignatureForSelector
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
-
instancesRespondToSelector
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
-
isSubclassOfClass
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
-
keyPathsForValuesAffectingValueForKey
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
-
new_objc
public static java.lang.Object new_objc()
-
requestWithURL
public static NSURLRequest requestWithURL(NSURL URL)
requestWithURL: Allocates and initializes an NSURLRequest with the given URL. Default values are used for cache policy (NSURLRequestUseProtocolCachePolicy) and timeout interval (60 seconds).- Parameters:
URL- The URL for the request.- Returns:
- A newly-created and autoreleased NSURLRequest instance.
-
requestWithURLCachePolicyTimeoutInterval
public static NSURLRequest requestWithURLCachePolicyTimeoutInterval(NSURL URL, long cachePolicy, double timeoutInterval)
requestWithURL:cachePolicy:timeoutInterval: Allocates and initializes a NSURLRequest with the given URL and cache policy.- Parameters:
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.- Returns:
- A newly-created and autoreleased NSURLRequest instance.
-
resolveClassMethod
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
-
resolveInstanceMethod
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
-
setVersion_static
public static void setVersion_static(long aVersion)
-
superclass_static
public static org.moe.natj.objc.Class superclass_static()
-
supportsSecureCoding
public static boolean supportsSecureCoding()
-
version_static
public static long version_static()
-
HTTPBody
public NSData HTTPBody()
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.- Returns:
- The request body data of the receiver.
-
HTTPBodyStream
public NSInputStream HTTPBodyStream()
Returns the request body stream of the receiver if any has been set The stream is returned for examination only; it is not safe for the caller to manipulate the stream in any way. Also note that the HTTPBodyStream and HTTPBody are mutually exclusive - only one can be set on a given request. Also note that the body stream is preserved across copies, but is LOST when the request is coded via the NSCoding protocol- Returns:
- The request body stream of the receiver.
-
HTTPMethod
public java.lang.String HTTPMethod()
Returns the HTTP request method of the receiver.- Returns:
- the HTTP request method of the receiver.
-
HTTPShouldHandleCookies
public boolean HTTPShouldHandleCookies()
Determine whether default cookie handling will happen for this request. NOTE: This value is not used prior to 10.3- Returns:
- YES if cookies will be sent with and set for this request; otherwise NO.
-
HTTPShouldUsePipelining
public boolean HTTPShouldUsePipelining()
Reports whether the receiver is not expected to wait for the previous response before transmitting.- Returns:
- YES if the receiver should transmit before the previous response is received. NO if the receiver should wait for the previous response before transmitting.
-
URL
public NSURL URL()
Returns the URL of the receiver.- Returns:
- The URL of the receiver.
-
allHTTPHeaderFields
public NSDictionary<java.lang.String,java.lang.String> allHTTPHeaderFields()
Returns a dictionary containing all the HTTP header fields of the receiver.- Returns:
- a dictionary containing all the HTTP header fields of the receiver.
-
allowsCellularAccess
public boolean allowsCellularAccess()
returns whether a connection created with this request is allowed to use the built in cellular radios (if present).- Returns:
- YES if the receiver is allowed to use the built in cellular radios to satify the request, NO otherwise.
-
cachePolicy
public long cachePolicy()
Returns the cache policy of the receiver.- Returns:
- The cache policy of the receiver.
-
copyWithZone
public java.lang.Object copyWithZone(org.moe.natj.general.ptr.VoidPtr zone)
- Specified by:
copyWithZonein interfaceNSCopying
-
encodeWithCoder
public void encodeWithCoder(NSCoder coder)
- Specified by:
encodeWithCoderin interfaceNSCoding
-
init
public NSURLRequest init()
-
initWithCoder
public NSURLRequest initWithCoder(NSCoder coder)
Description copied from interface:NSCodingNS_DESIGNATED_INITIALIZER- Specified by:
initWithCoderin interfaceNSCoding
-
initWithURL
public NSURLRequest initWithURL(NSURL URL)
initWithURL: Initializes an NSURLRequest with the given URL. Default values are used for cache policy (NSURLRequestUseProtocolCachePolicy) and timeout interval (60 seconds).- Parameters:
URL- The URL for the request.- Returns:
- An initialized NSURLRequest.
-
initWithURLCachePolicyTimeoutInterval
public NSURLRequest initWithURLCachePolicyTimeoutInterval(NSURL URL, long cachePolicy, double timeoutInterval)
initWithURL: Initializes an NSURLRequest with the given URL and cache policy. This is the designated initializer for the NSURLRequest class.- Parameters:
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.- Returns:
- An initialized NSURLRequest.
-
mainDocumentURL
public NSURL mainDocumentURL()
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 setMainDocumentURL: NOTE: In the current implementation, this value is unused by the framework. A fully functional version of this method will be available in the future.- Returns:
- The main document URL.
-
mutableCopyWithZone
public java.lang.Object mutableCopyWithZone(org.moe.natj.general.ptr.VoidPtr zone)
- Specified by:
mutableCopyWithZonein interfaceNSMutableCopying
-
networkServiceType
public long networkServiceType()
Returns the NSURLRequestNetworkServiceType associated with this request. This will return NSURLNetworkServiceTypeDefault for requests that have not explicitly set a networkServiceType (using the setNetworkServiceType method).- Returns:
- The NSURLRequestNetworkServiceType associated with this request.
-
_supportsSecureCoding
public boolean _supportsSecureCoding()
Description copied from interface:NSSecureCodingThis property must return YES on all classes that allow secure coding. Subclasses of classes that adopt NSSecureCoding and override initWithCoder: must also override this method and return YES. The Secure Coding Guide should be consulted when writing methods that decode data.- Specified by:
_supportsSecureCodingin interfaceNSSecureCoding
-
timeoutInterval
public double timeoutInterval()
Returns the timeout interval of the receiver. The timeout interval specifies the limit on the idle interval alloted 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.- Returns:
- The timeout interval of the receiver.
-
valueForHTTPHeaderField
public java.lang.String valueForHTTPHeaderField(java.lang.String field)
valueForHTTPHeaderField: 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.- Parameters:
field- the header field name to use for the lookup (case-insensitive).- Returns:
- the value associated with the given header field, or nil if there is no value associated with the given header field.
-
allowsConstrainedNetworkAccess
public boolean allowsConstrainedNetworkAccess()
returns whether a connection created with this request is allowed to use network interfaces which have been marked as constrained.- Returns:
- YES if the receiver is allowed to use an interface marked as constrained to satify the request, NO otherwise.
-
allowsExpensiveNetworkAccess
public boolean allowsExpensiveNetworkAccess()
returns whether a connection created with this request is allowed to use network interfaces which have been marked as expensive.- Returns:
- YES if the receiver is allowed to use an interface marked as expensive to satify the request, NO otherwise.
-
-