Skip to content

Commit 1e67552

Browse files
committed
Merge branch 'master' of github.com:AFNetworking/AFNetworking
2 parents ab00b95 + 9fba242 commit 1e67552

File tree

5 files changed

+42
-42
lines changed

5 files changed

+42
-42
lines changed

AFNetworking/AFHTTPClient.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,11 @@ typedef enum {
160160

161161
/**
162162
Initializes an `AFHTTPClient` object with the specified base URL.
163+
164+
This is the designated initializer.
163165
164166
@param url The base URL for the HTTP client. This argument must not be `nil`.
165167
166-
@discussion This is the designated initializer.
167-
168168
@return The newly-initialized HTTP client
169169
*/
170170
- (id)initWithBaseURL:(NSURL *)url;
@@ -191,11 +191,11 @@ typedef enum {
191191
/**
192192
Attempts to register a subclass of `AFHTTPRequestOperation`, adding it to a chain to automatically generate request operations from a URL request.
193193
194+
When `enqueueHTTPRequestOperationWithRequest:success:failure` is invoked, each registered class is consulted in turn to see if it can handle the specific request. The first class to return `YES` when sent a `canProcessRequest:` message is used to create an operation using `initWithURLRequest:` and do `setCompletionBlockWithSuccess:failure:`. There is no guarantee that all registered classes will be consulted. Classes are consulted in the reverse order of their registration. Attempting to register an already-registered class will move it to the top of the list.
195+
194196
@param operationClass The subclass of `AFHTTPRequestOperation` to register
195197
196198
@return `YES` if the registration is successful, `NO` otherwise. The only failure condition is if `operationClass` is not a subclass of `AFHTTPRequestOperation`.
197-
198-
@discussion When `enqueueHTTPRequestOperationWithRequest:success:failure` is invoked, each registered class is consulted in turn to see if it can handle the specific request. The first class to return `YES` when sent a `canProcessRequest:` message is used to create an operation using `initWithURLRequest:` and do `setCompletionBlockWithSuccess:failure:`. There is no guarantee that all registered classes will be consulted. Classes are consulted in the reverse order of their registration. Attempting to register an already-registered class will move it to the top of the list.
199199
*/
200200
- (BOOL)registerHTTPOperationClass:(Class)operationClass;
201201

@@ -283,13 +283,13 @@ typedef enum {
283283
/**
284284
Creates an `NSMutableURLRequest` object with the specified HTTP method and path, and constructs a `multipart/form-data` HTTP body, using the specified parameters and multipart form data block. See http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.2
285285
286+
Multipart form requests are automatically streamed, reading files directly from disk along with in-memory data in a single HTTP body. The resulting `NSMutableURLRequest` object has an `HTTPBodyStream` property, so refrain from setting `HTTPBodyStream` or `HTTPBody` on this request object, as it will clear out the multipart form body stream.
287+
286288
@param method The HTTP method for the request. This parameter must not be `GET` or `HEAD`, or `nil`.
287289
@param path The path to be appended to the HTTP client's base URL and used as the request URL.
288290
@param parameters The parameters to be encoded and set in the request HTTP body.
289291
@param block A block that takes a single argument and appends data to the HTTP body. The block argument is an object adopting the `AFMultipartFormData` protocol. This can be used to upload files, encode HTTP body as JSON or XML, or specify multiple values for the same parameter, as one might for array values.
290292
291-
@discussion Multipart form requests are automatically streamed, reading files directly from disk along with in-memory data in a single HTTP body. The resulting `NSMutableURLRequest` object has an `HTTPBodyStream` property, so refrain from setting `HTTPBodyStream` or `HTTPBody` on this request object, as it will clear out the multipart form body stream.
292-
293293
@return An `NSMutableURLRequest` object
294294
*/
295295
- (NSMutableURLRequest *)multipartFormRequestWithMethod:(NSString *)method
@@ -327,11 +327,11 @@ typedef enum {
327327

328328
/**
329329
Cancels all operations in the HTTP client's operation queue whose URLs match the specified HTTP method and path.
330+
331+
This method only cancels `AFHTTPRequestOperations` whose request URL matches the HTTP client base URL with the path appended. For complete control over the lifecycle of enqueued operations, you can access the `operationQueue` property directly, which allows you to, for instance, cancel operations filtered by a predicate, or simply use `-cancelAllRequests`. Note that the operation queue may include non-HTTP operations, so be sure to check the type before attempting to directly introspect an operation's `request` property.
330332
331333
@param method The HTTP method to match for the cancelled requests, such as `GET`, `POST`, `PUT`, or `DELETE`. If `nil`, all request operations with URLs matching the path will be cancelled.
332334
@param path The path appended to the HTTP client base URL to match against the cancelled requests. If `nil`, no path will be appended to the base URL.
333-
334-
@discussion This method only cancels `AFHTTPRequestOperations` whose request URL matches the HTTP client base URL with the path appended. For complete control over the lifecycle of enqueued operations, you can access the `operationQueue` property directly, which allows you to, for instance, cancel operations filtered by a predicate, or simply use `-cancelAllRequests`. Note that the operation queue may include non-HTTP operations, so be sure to check the type before attempting to directly introspect an operation's `request` property.
335335
*/
336336
- (void)cancelAllHTTPOperationsWithMethod:(NSString *)method path:(NSString *)path;
337337

@@ -342,11 +342,11 @@ typedef enum {
342342
/**
343343
Creates and enqueues an `AFHTTPRequestOperation` to the HTTP client's operation queue for each specified request object into a batch. When each request operation finishes, the specified progress block is executed, until all of the request operations have finished, at which point the completion block also executes.
344344
345+
Operations are created by passing the specified `NSURLRequest` objects in `requests`, using `-HTTPRequestOperationWithRequest:success:failure:`, with `nil` for both the `success` and `failure` parameters.
346+
345347
@param urlRequests The `NSURLRequest` objects used to create and enqueue operations.
346348
@param progressBlock A block object to be executed upon the completion of each request operation in the batch. This block has no return value and takes two arguments: the number of operations that have already finished execution, and the total number of operations.
347349
@param completionBlock A block object to be executed upon the completion of all of the request operations in the batch. This block has no return value and takes a single argument: the batched request operations.
348-
349-
@discussion Operations are created by passing the specified `NSURLRequest` objects in `requests`, using `-HTTPRequestOperationWithRequest:success:failure:`, with `nil` for both the `success` and `failure` parameters.
350350
*/
351351
- (void)enqueueBatchOfHTTPRequestOperationsWithRequests:(NSArray *)urlRequests
352352
progressBlock:(void (^)(NSUInteger numberOfFinishedOperations, NSUInteger totalNumberOfOperations))progressBlock
@@ -506,13 +506,13 @@ typedef enum {
506506
/**
507507
Returns a query string constructed by a set of parameters, using the specified encoding.
508508
509+
Query strings are constructed by collecting each key-value pair, percent escaping a string representation of the key-value pair, and then joining the pairs with "&".
510+
511+
If a query string pair has a an `NSArray` for its value, each member of the array will be represented in the format `field[]=value1&field[]value2`. Otherwise, the pair will be formatted as "field=value". String representations of both keys and values are derived using the `-description` method. The constructed query string does not include the ? character used to delimit the query component.
512+
509513
@param parameters The parameters used to construct the query string
510514
@param encoding The encoding to use in constructing the query string. If you are uncertain of the correct encoding, you should use UTF-8 (`NSUTF8StringEncoding`), which is the encoding designated by RFC 3986 as the correct encoding for use in URLs.
511515
512-
@discussion Query strings are constructed by collecting each key-value pair, percent escaping a string representation of the key-value pair, and then joining the pairs with "&".
513-
514-
If a query string pair has a an `NSArray` for its value, each member of the array will be represented in the format `field[]=value1&field[]value2`. Otherwise, the pair will be formatted as "field=value". String representations of both keys and values are derived using the `-description` method. The constructed query string does not include the ? character used to delimit the query component.
515-
516516
@return A percent-escaped query string
517517
*/
518518
extern NSString * AFQueryStringFromParametersWithEncoding(NSDictionary *parameters, NSStringEncoding encoding);
@@ -545,13 +545,13 @@ extern NSTimeInterval const kAFUploadStream3GSuggestedDelay;
545545
/**
546546
Appends the HTTP header `Content-Disposition: file; filename=#{generated filename}; name=#{name}"` and `Content-Type: #{generated mimeType}`, followed by the encoded file data and the multipart form boundary.
547547
548+
The filename and MIME type for this data in the form will be automatically generated, using the last path component of the `fileURL` and system associated MIME type for the `fileURL` extension, respectively.
549+
548550
@param fileURL The URL corresponding to the file whose content will be appended to the form. This parameter must not be `nil`.
549551
@param name The name to be associated with the specified data. This parameter must not be `nil`.
550552
@param error If an error occurs, upon return contains an `NSError` object that describes the problem.
551553
552554
@return `YES` if the file data was successfully appended, otherwise `NO`.
553-
554-
@discussion The filename and MIME type for this data in the form will be automatically generated, using the last path component of the `fileURL` and system associated MIME type for the `fileURL` extension, respectively.
555555
*/
556556
- (BOOL)appendPartWithFileURL:(NSURL *)fileURL
557557
name:(NSString *)name
@@ -625,10 +625,10 @@ extern NSTimeInterval const kAFUploadStream3GSuggestedDelay;
625625
/**
626626
Throttles request bandwidth by limiting the packet size and adding a delay for each chunk read from the upload stream.
627627
628+
When uploading over a 3G or EDGE connection, requests may fail with "request body stream exhausted". Setting a maximum packet size and delay according to the recommended values (`kAFUploadStream3GSuggestedPacketSize` and `kAFUploadStream3GSuggestedDelay`) lowers the risk of the input stream exceeding its allocated bandwidth. Unfortunately, as of iOS 6, there is no definite way to distinguish between a 3G, EDGE, or LTE connection. As such, it is not recommended that you throttle bandwidth based solely on network reachability. Instead, you should consider checking for the "request body stream exhausted" in a failure block, and then retrying the request with throttled bandwidth.
629+
628630
@param numberOfBytes Maximum packet size, in number of bytes. The default packet size for an input stream is 32kb.
629631
@param delay Duration of delay each time a packet is read. By default, no delay is set.
630-
631-
@discussion When uploading over a 3G or EDGE connection, requests may fail with "request body stream exhausted". Setting a maximum packet size and delay according to the recommended values (`kAFUploadStream3GSuggestedPacketSize` and `kAFUploadStream3GSuggestedDelay`) lowers the risk of the input stream exceeding its allocated bandwidth. Unfortunately, as of iOS 6, there is no definite way to distinguish between a 3G, EDGE, or LTE connection. As such, it is not recommended that you throttle bandwidth based solely on network reachability. Instead, you should consider checking for the "request body stream exhausted" in a failure block, and then retrying the request with throttled bandwidth.
632632
*/
633633
- (void)throttleBandwidthWithPacketSize:(NSUInteger)numberOfBytes
634634
delay:(NSTimeInterval)delay;

AFNetworking/AFHTTPRequestOperation.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@
112112
/**
113113
Sets the `completionBlock` property with a block that executes either the specified success or failure block, depending on the state of the request on completion. If `error` returns a value, which can be caused by an unacceptable status code or content type, then `failure` is executed. Otherwise, `success` is executed.
114114
115+
This method should be overridden in subclasses in order to specify the response object passed into the success block.
116+
115117
@param success The block to be executed on the completion of a successful request. This block has no return value and takes two arguments: the receiver operation and the object constructed from the response data of the request.
116118
@param failure The block to be executed on the completion of an unsuccessful request. This block has no return value and takes two arguments: the receiver operation and the error that occurred during the request.
117-
118-
@discussion This method should be overridden in subclasses in order to specify the response object passed into the success block.
119119
*/
120120
- (void)setCompletionBlockWithSuccess:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
121121
failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure;

AFNetworking/AFNetworkActivityIndicatorManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
/**
4545
A Boolean value indicating whether the manager is enabled.
4646
47-
@discussion If YES, the manager will change status bar network activity indicator according to network operation notifications it receives. The default value is NO.
47+
If YES, the manager will change status bar network activity indicator according to network operation notifications it receives. The default value is NO.
4848
*/
4949
@property (nonatomic, assign, getter = isEnabled) BOOL enabled;
5050

0 commit comments

Comments
 (0)