Commit Graph

103 Commits

Author SHA1 Message Date
Blake Watters
016f13dad0 Convert all tabs to four spaces. refs #743 2012-05-17 18:10:59 -04:00
Blake Watters
fcb973056b Cleanup trailing whitespace. refs #743 2012-05-17 18:00:16 -04:00
Blake Watters
938304d542 Fixes to ensure failed requests are not resent. refs #628, fixes #744, closes #720
Additional changes and test coverage to handle the case of loading an invalid URL
or otherwise immediately encountering an error condition:

* Restores use of removeLoadingRequest: within the queue
* Updates fragile tests to ensure better coverage for error cases
* Sets isLoaded to YES during error callbacks to prevent duplicated dispatching
2012-05-16 23:50:43 -04:00
Christopher Swasey
6351fd428f Revert those calls to the nonexistent NSURL-originalPath method back to -path 2012-05-10 12:57:31 -04:00
Christopher Swasey
856854a66b Merge in @theorm's additions to RKRequest, and re-vendor cocoa-oauth from our fork with @theorm's additions applied 2012-05-10 12:57:31 -04:00
Blake Watters
4071fa9a32 Integrated support for configuring runLoopMode on a per request basis. closes #560 2012-04-17 21:28:48 -04:00
Marcus Brito
ea100b6aac Add a RKRequest attribute to control redirect handling
The default behavior is the same as before, to follow redirects. If RKRequest.followRedirect is set to NO, then a redirect (301, 302, 307) response will not be followed, and the request processing will proceed using the current request only.
2012-04-17 21:16:32 -04:00
Blake Watters
757e01e1f3 Change reachabilityObserver reference to retain for RKRequest 2012-04-09 17:38:49 -04:00
Blake Watters
2723a11294 Reorganized categories under RKAdditions naming convention. Expanded documentation. 2012-04-04 09:08:55 -04:00
Blake Watters
457a6126cf Refresh copyright notices for all source files 2012-04-04 09:08:54 -04:00
Blake Watters
0771b3e9b3 Added macro for ignoring delegate messages sent after an RKRequest has been cancelled.
Fixes intermittent crash in the test suite due to authentication challenge callbacks being
processed after the request is through. fixes #639
2012-04-03 23:39:55 -04:00
Blake Watters
175a90cabe Reorder logging statement so that logging occurs before sending of request to avoid sending message to a zombie instance. fixes #600 2012-03-20 20:43:14 -04:00
Blake Watters
0d709dbc07 Migrate dangling invocations of NSLog -> RKLog. refs #578 2012-03-20 20:43:14 -04:00
Blake Watters
749c6e389f Fix retain cycle causing leak for backgroundPolicy RKRequestBackgroundPolicyContinue. closes #548 2012-03-12 18:50:33 -04:00
Blake Watters
0448090504 Disabled invalid caching behavior for PUT & POST responses. fixes #589 2012-03-12 18:33:35 -04:00
Rui D Lopes
693d839364 Adding the ability to set a default content decoding other than NSUTF8StringEncoding whenever HTTP headers do not contain any information. closes #547 2012-02-15 14:28:03 -05:00
Blake Watters
948cc85873 Added new pre-flight delegate callbacks for customization of RKRequest and RKObjectLoader instances before dispatch 2012-02-15 12:06:24 -05:00
Blake Watters
4142ffdb42 Reorganization and cleanups of Unit Tests
* Reorganized tests to accommodate split into Logic & Application.
* Eliminated 'Spec' naming in favor of 'Test' as the suite is entirely based on SenTest.
* Pulled majority of testing support classes up into the library and documented them.
* Introduced RKApplicationTests app for running the RKTableController UI tests
2012-02-10 17:32:23 -05:00
Blake Watters
a5cb5f5060 Implemented helper functions for converting between Strings and RKRequestMethod enum types. 2012-02-10 16:30:58 -05:00
Blake Watters
3d0f0ab39e Introduced the RKTableController component for iOS.
RKTableController provides a flexible, integrated system for driving iOS table views using
the RestKit object mapping engine. Local domain objects can be mapped into table cells within a
collection or presented for editing as part of a form. There are three flavors of table controllers
available:

* Static Tables: RKTableController can be used to render simple static tables that are composed of RKTableItems
presented in RKTableSections. Table items can quickly be built and added to a table without a backing model
or can have content object mapped into them for presentation.
* Network Tables: RKTableController can also render a table with the results of a network load. The typical use
case here is to have RestKit retrieve a JSON/XML payload from your remote system and then render the content into
a table.
* Core Data Tables: RKFetchedResultsTableController can efficiently drive a table view using objects pulled from a
Core Data managed object context. Typical use-cases here are for the presentation of large collections that are
pulled from a remote system, offering offline access, or speeding up a UI by using Core Data as a fast local cache.

RKTableController supports a number of bells and whistles including integrated searching/filtering and pull to refresh.
2012-02-10 16:30:54 -05:00
Brian Morton
58102533f1 Fixes an issue where the timeoutTimer wouldn't work for a synchronous request. Fixes #551.
* Removed the timer creation in RKRequest sendSynchronously.
* Pass the timeoutInterval to the NSURLRequest that is responsible for the synchronous request.
* Check if the error returned by NSURLRequest is NSURLErrorTimedOut and return an RKRequestConnectionTimeoutError if necessary.
* Add test for making sure the timeout works properly for a synchronous request.
2012-02-08 20:06:53 -08:00
Blake Watters
a719843c91 Drop the client prefix from the SSL validation properties added to RKRequest 2012-01-24 11:47:31 -05:00
Christopher Swasey
7ea39690c5 Decouple RKResponse from sharedClient Fixes #430 2012-01-23 18:21:22 -05:00
Brian Morton
b0fd4d4981 Remove duplicate timer creation. Fixes #517. 2012-01-23 10:33:13 -05:00
Brian Morton
7c84d89bdf Move RKRequest timeoutTimer creation to a helper method so that we can test the number of times it is invoked. 2012-01-23 10:33:07 -05:00
Jeff Arena
c0cd23a14d Add setBody:forMIMEType: method to RKRequest. Fixes #227. 2012-01-20 14:09:25 -05:00
Blake Watters
1d27f7bbbe Refactored object manager API's to de-emphasize delegates and removal duplication of blocks and delegates. Added block callbacks to RKObjectLoader. 2012-01-20 10:21:56 -05:00
Blake Watters
415ef5a193 Cleaned up all broken specs related to RKObjectPaginator and RKURL changes 2012-01-20 10:21:18 -05:00
Blake Watters
412b0f9756 Work in progress on cleanup 2012-01-20 10:21:18 -05:00
Brian Morton
90716335f5 Add support for timing out an RKRequest via a timeoutTimer and a timeout property.
* Add timeoutInterval property on RKRequest with a default value of 120.0
* Add timeout method that is called by the timer when the timeout interval has been exceeded to cancel the request and return an error via didFailLoadWithError:
* Add invalidateTimeoutTimer method that is called by RKResponse when the NSURLConnection begins receiving data.
* Add call to invalidateTimeoutTimer in RKRequest cancelAndInformDelegate: so we don't have a dangling timer.
* Add timer creation to sendAsynchronously and sendSynchronously
2012-01-20 09:19:45 -05:00
Brian Morton
dab403a9c1 Responsibly invalidate the timeoutTimer when the RKRequest is deallocated. Move location of timer creation for asynchronous request. 2012-01-20 09:17:00 -05:00
Ray Fix
7be7da61cb Fix for ocassional crashes using http basic auth 2012-01-09 20:10:39 -05:00
David Young-Chan Kay
6a18ebd91b RKRequest: Added null check for HTTP Basic username and password. Closes #493. 2012-01-09 20:08:26 -05:00
Blake Watters
af7a7d22b6 Lowered logging level for body from Info to Debug 2011-12-15 13:41:00 -05:00
Blake Watters
479864902b Fixed all build warnings on OS X Framework target 2011-12-08 23:23:20 -05:00
Blake Watters
563f5e909b Updated all example projects to build against the new project. Cleaned up header imports for flattened project structure 2011-12-02 09:26:36 -05:00
Tony Lee
a5661061ec The OAuth use correct parameters to make signature for HTTP PUT/POST. 2011-11-10 17:29:27 +08:00
Blake Watters
d75fd7d0b0 Refactored RKReachabilityObserver to work around issues with iOS 5 + host reachability and expand its capabilities. closes #408
* Added support for monitoring by IP address or hostname as well as local Wifi and Internet access generally
* Eliminated usage of synchronous calls to obtain reachability flags during status checks
* Reworked SystemConfiguration reachability callback to cache flags
* RKClient now monitors Internet access instead of hostname based reachability by default. baseURLReachabilityObserver eliminated in favor of reachabilityObserver. It is now a retain property that can be customized
* Queue suspension is now tied to the reachability observer rather than baseURL mutation
2011-10-19 08:51:37 -04:00
Blake Watters
eb9dec5953 Replaced TDOAuth with GCOAuth. fixes #407 2011-10-18 23:51:49 -04:00
Blake Watters
214efd31d5 Fix issue with incorrectly built OAuth 1.0 invocation of TDOAuth. fixes #396
Began cleanup of some category methods to eliminate duplicated functionality across the library.
2011-10-12 09:55:38 -04:00
OpenThread
f894226908 Implemented full support for generation of cache keys on RKParams. fixes #272
* Builds on work started by @OpenFibers.
* Should eliminate all cache warnings.
* Added FileMD5Hash library for efficiently computing MD5 for files
* Extended RKParams to return composite MD5 for all attachments
* Implemented MD5 method on each RKParamsAttachment instance
* Updated RKRequest to utilize new MD5 sums and enabled cache keys for RKParams
2011-09-28 23:20:26 -04:00
Blake Watters
eb887e38c6 Refactored OAuth support for merge into master. fixes #84, #211
Cleaned up @rodchile's excellent work integration OAuth 1.0 and 2.0 into RestKit. Changes
are as follows:

* Introduced new RKRequestAuthenticationType to replace the forceBasicAuthentication and other
    methods for influencing how authorization works.
* Moved TDOAuth code into Vendor/
* Renamed authorization code flow classes and delegate methods for clarity.
2011-09-20 15:52:17 -04:00
Greg Combs
62d7042ebc Merge pull request #334 from parkerboundy/add-apache-license
Add the Apache License to headers (Issue #145) Closes #145.  Thanks @parkerboundy.
2011-09-14 21:56:15 -07:00
Blake Watters
6ed37f0eb9 Fix Cocoa 512 errors logged from RKRequestCache. fixes #246
The following changes were made:
* Added isCacheable to RKRequest
* Return nil for cacheKey on non-cacheable RKRequests
* Updated RKRequestCache to ensure attempts to cache uncacheable requests has no effect
* Added basic unit tests and expanded comments on some parts of the cache API
2011-09-07 22:39:57 -04:00
Parker
e8b24a3959 added apache license to everything in the Network directory
I got tired of doing individual commits for each file, so I just did the
rest of the directory.
2011-09-07 10:45:42 -04:00
Blake Watters
218555b195 Do not add headers for params if the request is a GET or a HEAD. refs #303 2011-08-27 19:10:48 -04:00
Blake Watters
84032d9aa6 De-emphasized the use of the sharedQueue and improved management of queue suspension state when changing out the baseURL on RKClient. This should prevent the queue from becoming suspended beyond the life of an RKClient that suspended it. Queues are now also properties on a per-client and per-request basis, so it is easier to segregated parts of your app into different queues. The relationship between RKRequest and RKRequestQueue should be decoupled at some point. 2011-08-18 11:48:37 -04:00
Blake Watters
7c6507cacf Update the mutable URL request when switching out the URL or resourcePath 2011-07-24 19:15:45 -04:00
Blake Watters
406c5a1f7c Added support for mutating URL and resourcePath on RKRequest and RKObjectLoader. closes #242 2011-07-24 16:51:19 -04:00
Blake Watters
ae29401841 Added specs for zero-length Content-Length header when params is nil or empty 2011-07-20 22:56:22 -04:00