init(url:mimeType:expectedContentLength:textEncodingName:)
Creates an initialized Urlresponse object with the URL, MIME type, length, and text encoding set to given values.
Declaration
init(url URL: URL, mimeType MIMEType: String?, expectedContentLength length: Int, textEncodingName name: String?)Parameters
- URL:
The URL for the new object.
- MIMEType:
The MIME type.
- length:
The expected content length.This value should be
–1if the expected length is undetermined - name:
The text encoding name. This value may be
nil.
Return Value
The initialized URL response.
Discussion
This is the designated initializer for URLResponse.