Up

NSURLResponse documentation

Authors

Generated by richard

Contents -

  1. Software documentation for the NSHTTPURLResponse class
  2. Software documentation for the NSURLResponse class

Software documentation for the NSHTTPURLResponse class

NSHTTPURLResponse : NSURLResponse

Declared in:
Foundation/NSURLResponse.h
Availability: MacOS-X 10.2.0, Base 1.13.0

HTTP specific additions to an NSURLResponse
Method summary

localizedStringForStatusCode: 

+ (NSString*) localizedStringForStatusCode: (int)statusCode;
Availability: MacOS-X 10.2.0, Base 1.13.0

Returns a string representation of a status code.

allHeaderFields 

- (NSDictionary*) allHeaderFields;
Availability: MacOS-X 10.2.0, Base 1.13.0

Returns a dictionary containing all the HTTP header fields.

statusCode 

- (int) statusCode;
Availability: MacOS-X 10.2.0, Base 1.13.0

Returns the HTTP status code for the response.

Software documentation for the NSURLResponse class

NSURLResponse : NSObject

Declared in:
Foundation/NSURLResponse.h
Conforms to:
NSCoding
NSCopying
Availability: MacOS-X 10.2.0, Base 1.13.0

The response to an NSURLRequest
Method summary

MIMEType 

- (NSString*) MIMEType;
Availability: MacOS-X 10.2.0, Base 1.13.0

Returns the receiver's MIME type.

URL 

- (NSURL*) URL;
Availability: MacOS-X 10.2.0, Base 1.13.0

Returns the receiver's URL.

expectedContentLength 

- (long long) expectedContentLength;
Availability: MacOS-X 10.2.0, Base 1.13.0

Returns the expected content length of the receiver or -1 if there is no idea of what the content length might be.
This value is advisory, not a definitive length.

initWithURL: MIMEType: expectedContentLength: textEncodingName: 

- (id) initWithURL: (NSURL*)URL MIMEType: (NSString*)MIMEType expectedContentLength: (int)length textEncodingName: (NSString*)name;
Availability: MacOS-X 10.2.0, Base 1.13.0

Initialises the receiver with the URL, MIMEType, expected length and text encoding name provided.

suggestedFilename 

- (NSString*) suggestedFilename;
Availability: MacOS-X 10.2.0, Base 1.13.0

Returns a suggested file name for storing the response data, with suggested names being found in the following order:
  • content-disposition header
  • last path component of URL
  • host name from URL
  • 'unknown'
If possible, an extension based on the MIME type of the response is also appended.
The result should always be a valid file name.

textEncodingName 

- (NSString*) textEncodingName;
Availability: MacOS-X 10.2.0, Base 1.13.0

Returns the name of the character set used where response data is text


Up