RBNetworkResponse Class Reference

Inherits from NSObject
Declared in RBNetworkResponse.h

Overview

A network operation response.

  isValid

Whether or not the response is valid. A response is valid if there was no error or cancellation.

@property (nonatomic, readonly) BOOL isValid

Declared In

RBNetworkResponse.h

  error

The error that occurred, or nil if no error occurred.

@property (nonatomic, readonly, nullable) NSError *error

Declared In

RBNetworkResponse.h

  wasCancelled

Whether or not the network operation was cancelled.

@property (nonatomic, readonly) BOOL wasCancelled

Declared In

RBNetworkResponse.h

  httpResponse

The raw NSHTTPURLResponse object.

@property (nonatomic, readonly, nonnull) NSHTTPURLResponse *httpResponse

Declared In

RBNetworkResponse.h

  data

The body data of the response.

@property (nonatomic, readonly, nullable) NSData *data

Declared In

RBNetworkResponse.h

  isCacheHit

Whether or not the response is from the cache.

@property (nonatomic, readonly) BOOL isCacheHit

Declared In

RBNetworkResponse.h

– initWithError:

Initializes a new network response with an error.

- (nonnull instancetype)initWithError:(nonnull NSError *)error

Parameters

error

The error that occurred.

Return Value

The initialized network response object.

Declared In

RBNetworkResponse.h

– initWithCancellation

Initializes a new network response with cancellation.

- (nonnull instancetype)initWithCancellation

Return Value

The initialized network response object.

Declared In

RBNetworkResponse.h

– initWithResponse:data:isCacheHit:

Initializes a new network response.

- (nonnull instancetype)initWithResponse:(nonnull NSHTTPURLResponse *)response data:(nullable NSData *)data isCacheHit:(BOOL)isCacheHit

Parameters

response

The NSHTTPURLResponse object received.

data

The final body data of the response.

isCacheHit

Whether or not the response is a cache hit.

Return Value

The initialized network response object.

Declared In

RBNetworkResponse.h