Skip to content

NSURLResponse

NSURLResponse 是 URL 请求的响应对象基类。HTTP 响应通常会是其子类 NSHTTPURLResponse

initWithURLMIMETypeExpectedContentLengthTextEncodingName

Section titled “initWithURLMIMETypeExpectedContentLengthTextEncodingName”

初始化响应实例。

initWithURLMIMETypeExpectedContentLengthTextEncodingName(url: NSURL, mimeType: string, length: number, name: string): void

Parameters:

NameTypeDescription
urlNSURL响应 URL。
mimeTypestringMIME 类型。
lengthnumber预期内容长度。
namestring文本编码名。

Return Value:

  • 无。

响应 URL。

URL(): NSURL

Return Value:

  • NSURL: 响应 URL。

MIME 类型。

MIMEType(): string

Return Value:

  • string: MIME 类型。

预期内容长度(字节)。

expectedContentLength(): number

Return Value:

  • number: 长度。

文本编码名。

textEncodingName(): string

Return Value:

  • string: 编码名。

建议保存文件名。

suggestedFilename(): string

Return Value:

  • string: 建议文件名。

当前运行时未额外暴露 NSURLResponse 的类成员。

头文件 API 清单

正在加载…

协议:,来源: