public class NSURLRequest extends NSObject implements NSSecureCoding, NSCopying, NSMutableCopying
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:
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.
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret| Modifier | Constructor and Description |
|---|---|
protected |
NSURLRequest(org.moe.natj.general.Pointer peer) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
_supportsSecureCoding()
This property must return YES on all classes that allow secure coding.
|
static boolean |
accessInstanceVariablesDirectly() |
NSDictionary<java.lang.String,java.lang.String> |
allHTTPHeaderFields()
Returns a dictionary containing all the HTTP header fields
of the receiver.
|
static NSURLRequest |
alloc() |
static NSURLRequest |
allocWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
boolean |
allowsCellularAccess()
returns whether a connection created with this request is allowed to use
the built in cellular radios (if present).
|
boolean |
allowsConstrainedNetworkAccess()
returns whether a connection created with this request is allowed to use
network interfaces which have been marked as constrained.
|
boolean |
allowsExpensiveNetworkAccess()
returns whether a connection created with this request is allowed to use
network interfaces which have been marked as expensive.
|
boolean |
assumesHTTP3Capable()
returns whether we assume that server supports HTTP/3.
|
long |
attribution()
Returns the NSURLRequestAttribution associated with this request.
|
static boolean |
automaticallyNotifiesObserversForKey(java.lang.String key) |
long |
cachePolicy()
Returns the cache policy of the receiver.
|
static void |
cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget) |
static void |
cancelPreviousPerformRequestsWithTargetSelectorObject(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.Class |
classForKeyedUnarchiver() |
java.lang.Object |
copyWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
static java.lang.String |
debugDescription_static() |
static java.lang.String |
description_static() |
void |
encodeWithCoder(NSCoder coder) |
static long |
hash_static() |
NSData |
HTTPBody()
Returns the request body data of the receiver.
|
NSInputStream |
HTTPBodyStream()
Returns the request body stream of the receiver
if any has been set
|
java.lang.String |
HTTPMethod()
Returns the HTTP request method of the receiver.
|
boolean |
HTTPShouldHandleCookies()
Determine whether default cookie handling will happen for
this request.
|
boolean |
HTTPShouldUsePipelining()
Reports whether the receiver is not expected to wait for the
previous response before transmitting.
|
NSURLRequest |
init() |
NSURLRequest |
initWithCoder(NSCoder coder)
NS_DESIGNATED_INITIALIZER
|
NSURLRequest |
initWithURL(NSURL URL)
initWithURL:
|
NSURLRequest |
initWithURLCachePolicyTimeoutInterval(NSURL URL,
long cachePolicy,
double timeoutInterval)
initWithURL:
|
static NSObject.Function_instanceMethodForSelector_ret |
instanceMethodForSelector(org.moe.natj.objc.SEL aSelector) |
static NSMethodSignature |
instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
instancesRespondToSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
isSubclassOfClass(org.moe.natj.objc.Class aClass) |
static NSSet<java.lang.String> |
keyPathsForValuesAffectingValueForKey(java.lang.String key) |
NSURL |
mainDocumentURL()
The main document URL associated with this load.
|
java.lang.Object |
mutableCopyWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
long |
networkServiceType()
Returns the NSURLRequestNetworkServiceType associated with this request.
|
static NSURLRequest |
new_objc() |
static NSURLRequest |
requestWithURL(NSURL URL)
requestWithURL:
|
static NSURLRequest |
requestWithURLCachePolicyTimeoutInterval(NSURL URL,
long cachePolicy,
double timeoutInterval)
requestWithURL:cachePolicy:timeoutInterval:
|
static boolean |
resolveClassMethod(org.moe.natj.objc.SEL sel) |
static boolean |
resolveInstanceMethod(org.moe.natj.objc.SEL sel) |
static void |
setVersion_static(long aVersion) |
static org.moe.natj.objc.Class |
superclass_static() |
static boolean |
supportsSecureCoding() |
double |
timeoutInterval()
Returns the timeout interval of the receiver.
|
NSURL |
URL()
Returns the URL of the receiver.
|
java.lang.String |
valueForHTTPHeaderField(java.lang.String field)
valueForHTTPHeaderField:
|
static long |
version_static() |
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, willChangeValuesAtIndexesForKeypublic static boolean accessInstanceVariablesDirectly()
public static NSURLRequest alloc()
public static NSURLRequest allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument)
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
public static java.lang.String debugDescription_static()
public static java.lang.String description_static()
public static long hash_static()
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
public static NSURLRequest new_objc()
public static NSURLRequest requestWithURL(NSURL URL)
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.public static NSURLRequest requestWithURLCachePolicyTimeoutInterval(NSURL URL, long cachePolicy, double timeoutInterval)
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.public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
public static void setVersion_static(long aVersion)
public static org.moe.natj.objc.Class superclass_static()
public static boolean supportsSecureCoding()
public static long version_static()
public NSData HTTPBody()
This data is sent as the message body of the request, as in done in an HTTP POST request.
public NSInputStream HTTPBodyStream()
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
public java.lang.String HTTPMethod()
public boolean HTTPShouldHandleCookies()
NOTE: This value is not used prior to 10.3
public boolean HTTPShouldUsePipelining()
public NSURL URL()
public NSDictionary<java.lang.String,java.lang.String> allHTTPHeaderFields()
public boolean allowsCellularAccess()
public long cachePolicy()
public java.lang.Object copyWithZone(org.moe.natj.general.ptr.VoidPtr zone)
copyWithZone in interface NSCopyingpublic void encodeWithCoder(NSCoder coder)
encodeWithCoder in interface NSCodingpublic NSURLRequest init()
public NSURLRequest initWithCoder(NSCoder coder)
NSCodinginitWithCoder in interface NSCodingpublic NSURLRequest initWithURL(NSURL URL)
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.public NSURLRequest initWithURLCachePolicyTimeoutInterval(NSURL URL, long cachePolicy, double timeoutInterval)
Initializes an NSURLRequest with the given URL and cache policy.
This is the designated initializer for the NSURLRequest class.
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.public NSURL mainDocumentURL()
This URL is used for the cookie "same domain as main document" policy, and attributing the request as a sub-resource of a user-specified URL. There may also be other future uses. See setMainDocumentURL:
public java.lang.Object mutableCopyWithZone(org.moe.natj.general.ptr.VoidPtr zone)
mutableCopyWithZone in interface NSMutableCopyingpublic long networkServiceType()
This will return NSURLNetworkServiceTypeDefault for requests that have not explicitly set a networkServiceType (using the setNetworkServiceType method).
public boolean _supportsSecureCoding()
NSSecureCoding_supportsSecureCoding in interface NSSecureCodingpublic double timeoutInterval()
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.
public java.lang.String valueForHTTPHeaderField(java.lang.String field)
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).public boolean allowsConstrainedNetworkAccess()
public boolean allowsExpensiveNetworkAccess()
public boolean assumesHTTP3Capable()
public long attribution()
This will return NSURLRequestAttributionDeveloper for requests that have not explicitly set an attribution.