A mutable URL load request that bridges to
NSURLRequest and you use when you need reference semantics or other Foundation-specific behavior.
- iOS 2.0+
- macOS 10.2+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
- watchOS 2.0+
NSMutable is a subclass of
NSURLRequest that allows you to change the request’s properties.
NSMutable only represents information about the request. Use other classes, such as
URLSession, to send the request to a server. See Fetching Website Data into Memory and Uploading Data to a Website for an introduction to these techniques.
Classes that create a network operation based on a request make a deep copy of that request. Thus, changing the request after creating a network operation has no effect on the ongoing operation. For example, if you use
data to create a data task from a request, and then later change the request, the data task continues using the original request.