# NSURLRequest documentation

frm@gnu.org
Generated at 2025-02-13 06:02:40 +0000
2006 Software Foundation, Inc.
Software documentation for the NSMutableURLRequest class
Foundation/NSURLRequest.h
Description forthcoming.
setCachePolicy:
cachePolicy
Sets the receiver's cache policy.
setMainDocumentURL:
URL
Sets the receiver's main document.
setTimeoutInterval:
seconds
Sets the receiver's timeout policy.
setURL:
URL
Sets the receiver's URL
Software documentation for the NSURLRequest class
Foundation/NSURLRequest.h
NSCoding
NSCopying
NSMutableCopying
This class encapsulates information about a request to load a URL, how to cache the results, and when to deal with a slow/hung load process by timing out.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
requestWithURL:
URL
Description forthcoming.
requestWithURL:
URL
cachePolicy:
cachePolicy
timeoutInterval:
timeoutInterval
Returns an autoreleased instance initialised with the specified URL, cachePolicy, and timeoutInterval.
URL
Returns the URL associated with the receiver.
cachePolicy
Returns the cache policy associated with the receiver.
initWithURL:
URL
Initialises the reveiver with the specified URL and with the default cache policy (NSURLRequestUseProtocolCachePolicy) and a sixty second timeout.
initWithURL:
URL
cachePolicy:
cachePolicy
timeoutInterval:
timeoutInterval
Initialises the receiver with the specified URL, cachePolicy, and timeoutInterval.
mainDocumentURL
Returns the main document URL for the receiver.
Currently unused.
This is intended for use with frames and similar situations where a main document has a large number of subsidiary documents.
timeoutInterval
Returns the timeout interval associated with the receiver.
This is a value in seconds specifying how long the load process may be inactive (waiting for data to arrive from the server) before the load is mconsidered to have failed due to a timeout.
Software documentation for the NSMutableURLRequest(GNUstep) category
Foundation/NSURLRequest.h
Description forthcoming.
setDebug:
d
Sets a flag to turn on low level debug logging for this request and the corresponding response. The previous vaue of the setting is returned.
setDebugLogDelegate:
d
Sets a delegate object to override logging of low level I/O of the request as it is sent and the corresponding response as it arrives.
The delegate object is not retained, so it is the responsibility of the caller to ensure that it persists until all I/O has completed.
This has no effect unless debug is turned on, but if debug is turned on it permits the delegate to override the default behavior of writing the data to stderr.
Software documentation for the NSMutableURLRequest(NSMutableHTTPURLRequest) category
Foundation/NSURLRequest.h
Description forthcoming.
addValue:
value
forHTTPHeaderField:
field
Appends the value to the specified header field, automatically inserting a comman field delimiter if necessary.
setAllHTTPHeaderFields:
headerFields
Sets all the string values in the supplied headerFields dictionary as header values in the receiver.
Non-string values are ignored.
setHTTPBody:
data
Sets the data to be sent as the body of the HTTP request.
Clears any value previously set by -setHTTPBodyStream: or -setHTTPBody:
setHTTPBodyStream:
inputStream
Sets the request body to be the contents of the given stream.
The stream should be unopened when it is set, and the load process for the request will open the stream and read its entire content forwarding it to the remote server.
Clears any value previously set by -setHTTPBody: or -setHTTPBodyStream:
setHTTPMethod:
method
Sets the method of the receiver.
setHTTPShouldHandleCookies:
should
Sets a flag to say whether cookies should automatically be added to the request and whether cookies in the response should be used.
setValue:
value
forHTTPHeaderField:
field
Sets the value for the specified header field, replacing any previously set value. Setting a `nil` value deletes a previously set header field.
Software documentation for the NSURLRequest(NSHTTPURLRequest) category
Foundation/NSURLRequest.h
HTTP specific additions to NSURLRequest
HTTPBody
Returns the body of the reques... this is the data sent in a POST request.
HTTPBodyStream
Returns the currently set stream (if any) to be used to provide data to send as the request body.
Of course, any attempt to modify this stream may mess up the load operation in progress.
HTTPMethod
Returns the HTTP method assiciated with the receiver.
HTTPShouldHandleCookies
Returns a flag indicating whether this request should use standard cookie handling (sending of cookies with the request and storing any cookies returned in the response.
allHTTPHeaderFields
Returns a dictionary of the HTTP header fields associated with the receiver.
valueForHTTPHeaderField:
field
Returns the value for a particular HTTP header field (by case insensitive comparison) or `nil` if no such header is set.