NSMutableURLRequest
A mutable URL load request that is independent of protocol or URL scheme.
Declaration
class NSMutableURLRequestOverview
In Swift, this object bridges to NSURLRequest and you use when you need reference semantics or other Foundation-specific behavior.
NSMutableURLRequest is a subclass of NSURLRequest that allows you to change the request’s properties.
NSMutableURLRequest 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 dataTask(with:completionHandler:) to create a data task from a request, and then later change the request, the data task continues using the original request.