Declared in UIWebView+AFNetworking.h

Overview

This category adds methods to the UIKit framework’s UIWebView class. The methods in this category provide increased control over the request cycle, including progress monitoring and success / failure handling.

Tasks

Properties

requestSerializer

@property (nonatomic, strong) AFHTTPRequestSerializer<AFURLRequestSerialization> *requestSerializer
Discussion

The request serializer used to serialize requests made with loadRequest:progress:success:failure:. By default, this is an instance of AFHTTPRequestSerializer.

Declared In

UIWebView+AFNetworking.h

responseSerializer

@property (nonatomic, strong) AFHTTPResponseSerializer<AFURLResponseSerialization> *responseSerializer
Discussion

The response serializer used to serialize responses made with loadRequest:progress:success:failure:. By default, this is an instance of AFHTTPResponseSerializer.

Declared In

UIWebView+AFNetworking.h

Instance Methods

loadRequest:progress:success:failure:

- (void)loadRequest:(NSURLRequest *)request progress:(void ( ^ ) ( NSUInteger bytesWritten , long long totalBytesWritten , long long totalBytesExpectedToWrite ))progress success:(NSString *( ^ ) ( NSHTTPURLResponse *response , NSString *HTML ))success failure:(void ( ^ ) ( NSError *error ))failure
Discussion

Asynchronously loads the specified request.

Parameters

request

A URL request identifying the location of the content to load.

progress

A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes three arguments: the number of bytes read since the last time the download progress block was called, the total bytes read, and the total bytes expected to be read during the request, as initially determined by the expected content size of the NSHTTPURLResponse object. This block may be called multiple times, and will execute on the main thread.

success

A block object to be executed when the request finishes loading successfully. This block has no return value and takes two arguments: the response, and the HTML string.

failure

A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error that occurred.

Declared In

UIWebView+AFNetworking.h