StructureFoundationNetworking5.9.0
URLRequest
struct URLRequest
Citizens in FoundationNetworking
Conformances
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
protocol CustomReflectable
A type that explicitly supplies its own mirror.
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol ReferenceConvertible
Decorates types which are backed by a Foundation reference type.
Members
init(url: URL, cachePolicy: URLRequest.CachePolicy, timeoutInterval: TimeInterval
) Creates and initializes a URLRequest with the given URL and cache policy.
var allHTTPHeaderFields: [String : String]?
A dictionary containing all the HTTP header fields of the receiver.
var allowsCellularAccess: Bool
true
if the receiver is allowed to use the built in cellular radios to satisfy the request,false
otherwise.var cachePolicy: URLRequest.CachePolicy
The cache policy of the receiver.
var customMirror: Mirror
var debugDescription: String
var description: String
var httpBody: Data?
This data is sent as the message body of the request, as in done in an HTTP POST request.
var httpBodyStream: InputStream?
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
var httpMethod: String?
The HTTP request method of the receiver.
var httpShouldHandleCookies: Bool
true
if cookies will be sent with and set for this request; otherwisefalse
.var httpShouldUsePipelining: Bool
true
if the receiver should transmit before the previous response is received.false
if the receiver should wait for the previous response before transmitting.var mainDocumentURL: URL?
The main document URL associated with this load.
var networkServiceType: URLRequest.NetworkServiceType
The URLRequest.NetworkServiceType associated with this request.
var timeoutInterval: TimeInterval
Returns the timeout interval of the receiver.
var url: URL?
The URL of the receiver.
static func == (URLRequest, URLRequest
) -> Bool func addValue(String, forHTTPHeaderField: String
) 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.
func hash(into: inout Hasher
) func setValue(String
?, forHTTPHeaderField: String) 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.
func value(forHTTPHeaderField: String
) -> String? The value which corresponds to the given header field. Note that, in keeping with the HTTP RFC, HTTP header field names are case-insensitive.
typealias CachePolicy
typealias NetworkServiceType
typealias ReferenceType