public class NSMutableURLRequest extends NSURLRequest
An NSMutableURLRequest object represents a mutable URL load request in a manner independent of protocol and URL scheme.
This specialization of NSURLRequest is provided to aid developers who may find it more convenient to mutate a single request object for a series of URL loads instead of creating an immutable NSURLRequest for each load. This programming model is supported by the following contract stipulation between NSMutableURLRequest and NSURLConnection: NSURLConnection makes a deep copy of each NSMutableURLRequest object passed to one of its initializers.
NSMutableURLRequest is designed to be extended to support protocol-specific data by adding categories to access a property object provided in an interface targeted at protocol implementors.
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret| Modifier | Constructor and Description |
|---|---|
protected |
NSMutableURLRequest(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() |
void |
addValueForHTTPHeaderField(java.lang.String value,
java.lang.String field)
addValue:forHTTPHeaderField:
|
NSDictionary<java.lang.String,java.lang.String> |
allHTTPHeaderFields()
Sets the HTTP header fields of the receiver to the given
dictionary.
|
static NSMutableURLRequest |
alloc() |
static NSMutableURLRequest |
allocWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
boolean |
allowsCellularAccess()
sets whether a connection created with this request is allowed to use
the built in cellular radios (if present).
|
boolean |
allowsConstrainedNetworkAccess()
sets whether a connection created with this request is allowed to use
network interfaces which have been marked as constrained.
|
boolean |
allowsExpensiveNetworkAccess()
sets 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()
Sets the NSURLRequestAttribution to associate with this request.
|
static boolean |
automaticallyNotifiesObserversForKey(java.lang.String key) |
void |
bindToHotspotHelperCommand(NEHotspotHelperCommand command)
bindToHotspotHelperCommand:
|
long |
cachePolicy()
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() |
static java.lang.String |
debugDescription_static() |
static java.lang.String |
description_static() |
static long |
hash_static() |
NSData |
HTTPBody()
Sets the request body data of the receiver.
|
NSInputStream |
HTTPBodyStream()
Sets the request body to be the contents of the given stream.
|
java.lang.String |
HTTPMethod()
Sets the HTTP request method of the receiver.
|
boolean |
HTTPShouldHandleCookies()
Decide whether default cookie handling will happen for
this request (YES if cookies should be sent with and set for this request;
otherwise NO).
|
boolean |
HTTPShouldUsePipelining()
Sets whether the request should not wait for the previous response
before transmitting (YES if the receiver should transmit before the previous response is
received.
|
NSMutableURLRequest |
init() |
NSMutableURLRequest |
initWithCoder(NSCoder coder)
NS_DESIGNATED_INITIALIZER
|
NSMutableURLRequest |
initWithURL(NSURL URL)
initWithURL:
|
NSMutableURLRequest |
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()
Sets the main document URL
|
long |
networkServiceType()
Sets the NSURLRequestNetworkServiceType to associate with this request
|
static NSMutableURLRequest |
new_objc() |
static NSMutableURLRequest |
requestWithURL(NSURL URL) |
static NSMutableURLRequest |
requestWithURLCachePolicyTimeoutInterval(NSURL URL,
long cachePolicy,
double timeoutInterval) |
static boolean |
resolveClassMethod(org.moe.natj.objc.SEL sel) |
static boolean |
resolveInstanceMethod(org.moe.natj.objc.SEL sel) |
void |
setAllHTTPHeaderFields(NSDictionary<java.lang.String,java.lang.String> value)
Sets the HTTP header fields of the receiver to the given
dictionary.
|
void |
setAllowsCellularAccess(boolean value)
sets whether a connection created with this request is allowed to use
the built in cellular radios (if present).
|
void |
setAllowsConstrainedNetworkAccess(boolean value)
sets whether a connection created with this request is allowed to use
network interfaces which have been marked as constrained.
|
void |
setAllowsExpensiveNetworkAccess(boolean value)
sets whether a connection created with this request is allowed to use
network interfaces which have been marked as expensive.
|
void |
setAssumesHTTP3Capable(boolean value)
returns whether we assume that server supports HTTP/3.
|
void |
setAttribution(long value)
Sets the NSURLRequestAttribution to associate with this request.
|
void |
setCachePolicy(long value)
The cache policy of the receiver.
|
void |
setHTTPBody(NSData value)
Sets the request body data of the receiver.
|
void |
setHTTPBodyStream(NSInputStream value)
Sets the request body to be the contents of the given stream.
|
void |
setHTTPMethod(java.lang.String value)
Sets the HTTP request method of the receiver.
|
void |
setHTTPShouldHandleCookies(boolean value)
Decide whether default cookie handling will happen for
this request (YES if cookies should be sent with and set for this request;
otherwise NO).
|
void |
setHTTPShouldUsePipelining(boolean value)
Sets whether the request should not wait for the previous response
before transmitting (YES if the receiver should transmit before the previous response is
received.
|
void |
setMainDocumentURL(NSURL value)
Sets the main document URL
|
void |
setNetworkServiceType(long value)
Sets the NSURLRequestNetworkServiceType to associate with this request
|
void |
setTimeoutInterval(double value)
Sets the timeout interval of the receiver.
|
void |
setURL(NSURL value)
The URL of the receiver.
|
void |
setValueForHTTPHeaderField(java.lang.String value,
java.lang.String field)
setValue:forHTTPHeaderField:
|
static void |
setVersion_static(long aVersion) |
static org.moe.natj.objc.Class |
superclass_static() |
static boolean |
supportsSecureCoding() |
double |
timeoutInterval()
Sets the timeout interval of the receiver.
|
NSURL |
URL()
The URL of the receiver.
|
static long |
version_static() |
copyWithZone, encodeWithCoder, mutableCopyWithZone, valueForHTTPHeaderFieldaccessibilityActivate, 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, willChangeValuesAtIndexesForKeyprotected NSMutableURLRequest(org.moe.natj.general.Pointer peer)
public static boolean accessInstanceVariablesDirectly()
public static NSMutableURLRequest alloc()
public static NSMutableURLRequest 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 NSMutableURLRequest new_objc()
public static NSMutableURLRequest requestWithURL(NSURL URL)
public static NSMutableURLRequest requestWithURLCachePolicyTimeoutInterval(NSURL URL, long cachePolicy, double timeoutInterval)
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.
HTTPBody in class NSURLRequestpublic NSInputStream HTTPBodyStream()
The provided stream should be unopened; the request will take over the stream's delegate. The entire stream's contents will be transmitted as the HTTP body of the request. Note that the body stream and the body data (set by setHTTPBody:, above) are mutually exclusive - setting one will clear the other.
HTTPBodyStream in class NSURLRequestpublic java.lang.String HTTPMethod()
HTTPMethod in class NSURLRequestpublic boolean HTTPShouldHandleCookies()
The default is YES - in other words, cookies are sent from and stored to the cookie manager by default. NOTE: In releases prior to 10.3, this value is ignored
HTTPShouldHandleCookies in class NSURLRequestpublic boolean HTTPShouldUsePipelining()
Calling this method with a YES 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.).
HTTPShouldUsePipelining in class NSURLRequestpublic NSURL URL()
URL in class NSURLRequestpublic void addValueForHTTPHeaderField(java.lang.String value,
java.lang.String field)
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).public NSDictionary<java.lang.String,java.lang.String> allHTTPHeaderFields()
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 answer YES when sent an -isKindOfClass:[NSString class] message. If either the key or value for a key-value pair answers NO when sent this message, the key-value pair is skipped.
allHTTPHeaderFields in class NSURLRequestpublic boolean allowsCellularAccess()
NO if the receiver should not be allowed to use the built in cellular radios to satisfy the request, YES otherwise. The default is YES.
allowsCellularAccess in class NSURLRequestpublic void bindToHotspotHelperCommand(NEHotspotHelperCommand command)
Binds the NSMutableURLRequest to the network interface associated with the NEHotspotHelperCommand object.
public long cachePolicy()
cachePolicy in class NSURLRequestpublic NSMutableURLRequest init()
init in class NSURLRequestpublic NSMutableURLRequest initWithCoder(NSCoder coder)
NSCodinginitWithCoder in interface NSCodinginitWithCoder in class NSURLRequestpublic NSMutableURLRequest initWithURL(NSURL URL)
NSURLRequestInitializes an NSURLRequest with the given URL.
Default values are used for cache policy (NSURLRequestUseProtocolCachePolicy) and timeout interval (60 seconds).
initWithURL in class NSURLRequestURL - The URL for the request.public NSMutableURLRequest initWithURLCachePolicyTimeoutInterval(NSURL URL, long cachePolicy, double timeoutInterval)
NSURLRequestInitializes an NSURLRequest with the given URL and cache policy.
This is the designated initializer for the NSURLRequest class.
initWithURLCachePolicyTimeoutInterval in class NSURLRequestURL - 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()
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 is used to implement the cookie "only from same domain as main document" policy, attributing this request as a sub-resource of a user-specified URL, and possibly other things in the future.
mainDocumentURL in class NSURLRequestpublic long networkServiceType()
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.
networkServiceType in class NSURLRequestpublic void setAllHTTPHeaderFields(NSDictionary<java.lang.String,java.lang.String> value)
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 answer YES when sent an -isKindOfClass:[NSString class] message. If either the key or value for a key-value pair answers NO when sent this message, the key-value pair is skipped.
public void setAllowsCellularAccess(boolean value)
NO if the receiver should not be allowed to use the built in cellular radios to satisfy the request, YES otherwise. The default is YES.
public void setCachePolicy(long value)
public void setHTTPBody(NSData value)
This data is sent as the message body of the request, as in done in an HTTP POST request.
public void setHTTPBodyStream(NSInputStream value)
The provided stream should be unopened; the request will take over the stream's delegate. The entire stream's contents will be transmitted as the HTTP body of the request. Note that the body stream and the body data (set by setHTTPBody:, above) are mutually exclusive - setting one will clear the other.
public void setHTTPMethod(java.lang.String value)
public void setHTTPShouldHandleCookies(boolean value)
The default is YES - in other words, cookies are sent from and stored to the cookie manager by default. NOTE: In releases prior to 10.3, this value is ignored
public void setHTTPShouldUsePipelining(boolean value)
Calling this method with a YES 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.).
public void setMainDocumentURL(NSURL value)
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 is used to implement the cookie "only from same domain as main document" policy, attributing this request as a sub-resource of a user-specified URL, and possibly other things in the future.
public void setNetworkServiceType(long value)
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.
public void setTimeoutInterval(double value)
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.
public void setURL(NSURL value)
public void setValueForHTTPHeaderField(java.lang.String value,
java.lang.String field)
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).public boolean _supportsSecureCoding()
NSSecureCoding_supportsSecureCoding in interface NSSecureCoding_supportsSecureCoding in class NSURLRequestpublic double timeoutInterval()
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.
timeoutInterval in class NSURLRequestpublic boolean allowsConstrainedNetworkAccess()
NO if the receiver should not be allowed to use an interface marked as constrained to satify the request, YES otherwise.
allowsConstrainedNetworkAccess in class NSURLRequestpublic boolean allowsExpensiveNetworkAccess()
NO if the receiver should not be allowed to use an interface marked as expensive to satify the request, YES otherwise.
allowsExpensiveNetworkAccess in class NSURLRequestpublic void setAllowsConstrainedNetworkAccess(boolean value)
NO if the receiver should not be allowed to use an interface marked as constrained to satify the request, YES otherwise.
public void setAllowsExpensiveNetworkAccess(boolean value)
NO if the receiver should not be allowed to use an interface marked as expensive to satify the request, YES otherwise.
public boolean assumesHTTP3Capable()
assumesHTTP3Capable in class NSURLRequestpublic long attribution()
Set to NSURLRequestAttributionUser if the URL was specified by the user. Defaults to NSURLRequestAttributionDeveloper.
attribution in class NSURLRequestpublic void setAssumesHTTP3Capable(boolean value)
public void setAttribution(long value)
Set to NSURLRequestAttributionUser if the URL was specified by the user. Defaults to NSURLRequestAttributionDeveloper.