NSHTTPURLResponse Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/Foundation.framework
Availability
Available in iOS 2.0 and later.
Companion guide
Declared in
NSURLResponse.h
Related sample code

Overview

An NSHTTPURLResponse object represents a response to an HTTP URL load request. It’s a subclass of NSURLResponse that provides methods for accessing information specific to HTTP protocol responses.

Adopted Protocols

NSCoding
NSCopying

Tasks

Getting HTTP Response Headers

Getting Response Status Code

Class Methods

localizedStringForStatusCode:

Returns a localized string corresponding to a specified HTTP status code.

+ (NSString *)localizedStringForStatusCode:(NSInteger)statusCode
Parameters
statusCode

The HTTP status code.

Return Value

A localized string suitable for displaying to users that describes the specified status code.

Availability
  • Available in iOS 2.0 and later.
Declared In
NSURLResponse.h

Instance Methods

allHeaderFields

Returns all the HTTP header fields of the receiver.

- (NSDictionary *)allHeaderFields
Return Value

A dictionary containing all the HTTP header fields of the receiver. By examining this dictionary clients can see the “raw” header information returned by the HTTP server.

Availability
  • Available in iOS 2.0 and later.
Declared In
NSURLResponse.h

statusCode

Returns the receiver’s HTTP status code.

- (NSInteger)statusCode
Return Value

The receiver’s HTTP status code.

Availability
  • Available in iOS 2.0 and later.
Declared In
NSURLResponse.h

Did this document help you? Yes It's good, but... Not helpful...