Commit graph

41 commits

Author SHA1 Message Date
Mattt Thompson
b723e5b75c Removing AFInternal category, opting instead to inline success and failure dispatch
Minor refactoring and reformatting of AFHTTPRequest subclasses

Changing AFXMLRequestOperation error to XMLError to match rest of subclasses
2012-02-20 20:22:46 -08:00
Peter Steinberger
28e580c961 Replaces a failure block with dispatchFailureBlock method
I missed that on the initial transform.
2012-02-08 15:05:19 -08:00
Peter Steinberger
800d05181d Simplify dispatchFailureBlock
As error is overridden to always return the custom error object we can
omit the extra error: parameter in dispatchFailureBlock, making the
code even simpler.
2012-02-08 15:04:29 -08:00
Peter Steinberger
30a5cea4fc Added methods to simplify calling the success/failure handlers. 2012-02-06 13:43:43 -08:00
Peter Steinberger
feaf0814c4 add support for setting custom success/failure callback queues. Defaults to main queue if nothing set. 2012-02-06 13:29:00 -08:00
Mattt Thompson
b782991065 Adding check for responseData having non-zero length for response object methods in AFHTTPRequestOperation subclasses 2012-01-20 11:03:08 -08:00
Jake Boxer
b3244d8e57 Make JSON requests allow text/javascript content 2011-12-11 01:10:01 -08:00
chaiwats
d1d94e6e77 fix unnecessary up-cast as discussed in #122 2011-11-22 16:50:21 +07:00
Mattt Thompson
1fbe7846dd Merge branch 'experimental-json-agnosticism' into experimental-0.8 2011-11-07 11:21:55 -06:00
Mattt Thompson
30ea7353d4 Refactoring success and failure callbacks for HTTP request operations and client, to add more information and make everything more consistent
Removing AFHTTPClient protocol
2011-10-24 13:08:58 -05:00
Mattt Thompson
283d9cffea Initial implementation of decoupling specific JSON libraries from AFNetworking, in favor of being able to specify which one to use 2011-10-24 10:49:25 -05:00
Dustin Barker
b906b62c59 Return JSON error or HTTP error. 2011-10-19 22:33:09 -07:00
Evan Long
436fbe82d1 AFJSONRequestOperation.m:
-Fixing an issue where all JSON parse errors are ignored. The operation.error
  was always being set to nil no what responseJSON set the error property to.

AFXMLRequestOperation.m:
  -Making sure the success callback for the iOS case is run on the main thread
2011-10-17 14:20:31 -07:00
Dick Brouwer
78242fd6a3 Fixed no content response bug 2011-10-12 16:42:31 -07:00
Mattt Thompson
c492d488d8 Further documentation revisions 2011-10-12 10:42:53 -05:00
Mattt Thompson
4f09d2c1bf Rearranging imports, like a pedant 2011-10-11 12:26:49 -05:00
Mattt Thompson
53d61e7eb2 Adding pre-processor directives to conditionally compile Mac equivalent of UIKit-dependent APIs 2011-10-11 10:39:41 -05:00
Mattt Thompson
72090fd4e2 Adding native JSON serialization macro check for Mac 2011-10-11 10:22:40 -05:00
Mattt Thompson
b7564e9f5a Refactoring implementation of AFHTTPRequest subclasses to fulfill AFHTTPClientOperation protocol 2011-10-10 10:41:29 -05:00
Mattt Thompson
c2be31d4fa First implementation of protocol for AFHTTPClient to register classes to automatically determine the appropriate operation to create
Wrapping AFURLConnectionOperation -setCompletionBlock: with blockSelf release pattern to avoid retain cycle
2011-10-05 15:44:51 -05:00
Mattt Thompson
2c478758a2 Adding Property List request operation
Refactoring implementation of AFHTTPRequestOperation and subclasses
2011-10-05 14:14:52 -05:00
Mattt Thompson
ccdc5f2d9b Approaching a reasonable design for restructuring AFHTTPRequestOperation and subclasses 2011-10-05 12:36:45 -05:00
Mattt Thompson
561df45eb7 Initial working implementation of new candidate class structure 2011-10-04 00:13:12 -05:00
Mattt Thompson
eda2d1a3f5 Expanding AFJSONRequestOperation and AFHTTPClient failure blocks to include the NSHTTPURLResponse object 2011-09-26 14:46:46 -05:00
Mattt Thompson
65719ef895 Adding __unused designation to AFJSONRequestOperation operationWithRequest:success:failure: block parameters as appropriate 2011-09-26 10:17:04 -05:00
Mattt Thompson
9a78cc54cd Dispatching callbacks to main thread for JSON requests 2011-09-21 16:07:25 -05:00
Mattt Thompson
db4c852e3d [Issue #33] Changing return type of class method object contructors from id to an actual instance of that class 2011-09-21 15:33:20 -05:00
Mattt Thompson
e2a00952aa Revising AFJSONRequestOperation documentation
When nil is specified as acceptable status code or content type, don't perform those validations (i.e. accept any value)
2011-09-18 14:06:22 -05:00
Mattt Thompson
d62af91ac9 [Issue #16] Formalizing AFNetworkingErrorDomain, and constructing errors accordingly 2011-09-15 12:06:25 -05:00
Adam Ernst
ea156ec3c2 Only check HTTP status code and content type if there isn't already an error passed in to the completion block. Otherwise network errors are overwritten by a faulty error stating the HTTP status code is 0. 2011-08-24 15:41:32 -04:00
Mattt Thompson
4f9c1a12dd Fixing no data success callback parameters 2011-08-14 20:37:05 -05:00
Mattt Thompson
d22ed88d58 Merge pull request #9 from dstnbrkr/master
Handle responses with no content (ex. http status code 204)
2011-08-14 18:35:52 -07:00
Mattt Thompson
390c51a30d Merge branch 'gzip-compression-experimental' into experimental-gcd-processing
Conflicts:
	AFNetworking/AFHTTPRequestOperation.m
	AFNetworking/AFImageRequestOperation.m
	AFNetworking/AFJSONRequestOperation.m
2011-08-14 20:06:03 -05:00
Mattt Thompson
da1fa38bd4 Creating custom GCD queues for JSON and image request processing 2011-08-14 19:46:33 -05:00
dstnbrkr
fa0297f1b8 Call success with nil if response data has length == 0.
Fixes exception when attempting to parse empty response data (i.e. HTTP Status Code 204 No Content).
2011-08-10 14:08:07 -07:00
Mattt Thompson
f9073df97b Wrapping JSON and image processing in GCD async dispatch 2011-08-09 14:53:23 -05:00
Mattt Thompson
63ecf4bc98 Expanding success and failure block of most explicit signature for AFJSONRequestOperation to include request and response objects 2011-08-05 11:50:51 -05:00
Jon Parise
359d51d84a Improving the check for NSJSONSerialization.
We now only attempt to use NSJSONSerialization if we're compiling
against a Base SDK that includes it.  If we are, we still retain the
NS_CLASS_AVAILABLE-based `class` check to test whether or not it's
available at runtime.

The fallback in both cases is to use JSONKit.
2011-08-03 21:19:49 -07:00
Mattt Thompson
a5a31f4609 Checking for NSJSONSerialization using NS_CLASS_AVAILABLE macro instead of NSClassFromString 2011-08-03 13:11:01 -05:00
Mattt Thompson
68dc7e866e Using NSJSONSerializer when supported, falling back on JSONKit
Changing return type for JSON response from NSDictionary to id, to support non-dictionary top-level elements in response, such as arrays

Defining default acceptable content types and status codes as class methods in AFJSONRequestOperation

Adding text/json to acceptable MIME type for JSON
2011-08-03 11:31:00 -05:00
Mattt Thompson
f169a93f58 Moving AFNetworking classes into correct directory 2011-07-27 15:20:37 -05:00
Renamed from Example/AFJSONRequestOperation.m (Browse further)