├── .gitignore ├── DMRESTRequestExample ├── podfile ├── DMRESTRequestExample │ ├── en.lproj │ │ ├── InfoPlist.strings │ │ └── ViewController.xib │ ├── Default.png │ ├── Default@2x.png │ ├── Default-568h@2x.png │ ├── ViewController.h │ ├── DMRESTRequestExample-Prefix.pch │ ├── main.m │ ├── AppDelegate.h │ ├── DMRESTRequestExample-Info.plist │ ├── AppDelegate.m │ └── ViewController.m ├── DMRESTRequestExample.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcuserdata │ │ └── Dimillian.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcshareddata │ │ └── DMRESTRequestExample.xccheckout ├── DMRESTRequestExample.xcodeproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcuserdata │ │ │ ├── Dimillian.xcuserdatad │ │ │ │ └── UserInterfaceState.xcuserstate │ │ │ └── tricouard.xcuserdatad │ │ │ │ └── UserInterfaceState.xcuserstate │ │ └── xcshareddata │ │ │ └── DMRESTRequestExample.xccheckout │ ├── xcuserdata │ │ ├── Dimillian.xcuserdatad │ │ │ └── xcschemes │ │ │ │ ├── xcschememanagement.plist │ │ │ │ └── DMRESTRequestExample.xcscheme │ │ └── tricouard.xcuserdatad │ │ │ ├── xcschemes │ │ │ ├── xcschememanagement.plist │ │ │ └── DMRESTRequestExample.xcscheme │ │ │ └── xcdebugger │ │ │ └── Breakpoints.xcbkptlist │ └── project.pbxproj └── Podfile.lock ├── DMRESTRequest ├── DMRESTRequestTests │ ├── en.lproj │ │ └── InfoPlist.strings │ ├── DMRESTRequestTests.h │ ├── DMRESTRequestTests-Info.plist │ └── DMRESTRequestTests.m ├── DMRESTRequest │ ├── DMRESTRequest-Prefix.pch │ ├── NSString+TotalEscaping.h │ ├── DMJSONCache.h │ ├── NSString+TotalEscaping.m │ ├── DMRESTSettings.m │ ├── DMRESTSettings.h │ ├── DMJSONCache.m │ ├── DMRESTRequest.h │ └── DMRESTRequest.m └── DMRESTRequest.xcodeproj │ ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcuserdata │ │ ├── Dimillian.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ │ └── tricouard.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcshareddata │ │ └── DMRESTRequest.xccheckout │ ├── xcuserdata │ ├── Dimillian.xcuserdatad │ │ └── xcschemes │ │ │ ├── xcschememanagement.plist │ │ │ └── DMRESTRequest.xcscheme │ └── tricouard.xcuserdatad │ │ ├── xcschemes │ │ ├── xcschememanagement.plist │ │ └── DMRESTRequest.xcscheme │ │ └── xcdebugger │ │ └── Breakpoints.xcbkptlist │ └── project.pbxproj ├── DMRESTRequest.podspec ├── LICENSE └── readme.md /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | .DS_Store 3 | DMRESTRequestExample/Pods/* -------------------------------------------------------------------------------- /DMRESTRequestExample/podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '6.0' 2 | pod 'DMRESTRequest', :path => '../' -------------------------------------------------------------------------------- /DMRESTRequest/DMRESTRequestTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /DMRESTRequestExample/DMRESTRequestExample/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /DMRESTRequestExample/DMRESTRequestExample/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dimillian/DMRESTRequest-objc/master/DMRESTRequestExample/DMRESTRequestExample/Default.png -------------------------------------------------------------------------------- /DMRESTRequestExample/DMRESTRequestExample/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dimillian/DMRESTRequest-objc/master/DMRESTRequestExample/DMRESTRequestExample/Default@2x.png -------------------------------------------------------------------------------- /DMRESTRequestExample/DMRESTRequestExample/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dimillian/DMRESTRequest-objc/master/DMRESTRequestExample/DMRESTRequestExample/Default-568h@2x.png -------------------------------------------------------------------------------- /DMRESTRequest/DMRESTRequest/DMRESTRequest-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'DMRESTRequest' target in the 'DMRESTRequest' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /DMRESTRequestExample/DMRESTRequestExample.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /DMRESTRequest/DMRESTRequest.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DMRESTRequestExample/DMRESTRequestExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DMRESTRequestExample/DMRESTRequestExample.xcworkspace/xcuserdata/Dimillian.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dimillian/DMRESTRequest-objc/master/DMRESTRequestExample/DMRESTRequestExample.xcworkspace/xcuserdata/Dimillian.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /DMRESTRequest/DMRESTRequest.xcodeproj/project.xcworkspace/xcuserdata/Dimillian.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dimillian/DMRESTRequest-objc/master/DMRESTRequest/DMRESTRequest.xcodeproj/project.xcworkspace/xcuserdata/Dimillian.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /DMRESTRequest/DMRESTRequest.xcodeproj/project.xcworkspace/xcuserdata/tricouard.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dimillian/DMRESTRequest-objc/master/DMRESTRequest/DMRESTRequest.xcodeproj/project.xcworkspace/xcuserdata/tricouard.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /DMRESTRequestExample/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - DMRESTRequest (1.0.1) 3 | 4 | DEPENDENCIES: 5 | - DMRESTRequest (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | DMRESTRequest: 9 | :path: ../ 10 | 11 | SPEC CHECKSUMS: 12 | DMRESTRequest: 2cccdd3294d3c236275c0bf2ca850164041e1b44 13 | 14 | COCOAPODS: 0.26.2 15 | -------------------------------------------------------------------------------- /DMRESTRequestExample/DMRESTRequestExample.xcodeproj/project.xcworkspace/xcuserdata/Dimillian.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dimillian/DMRESTRequest-objc/master/DMRESTRequestExample/DMRESTRequestExample.xcodeproj/project.xcworkspace/xcuserdata/Dimillian.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /DMRESTRequestExample/DMRESTRequestExample.xcodeproj/project.xcworkspace/xcuserdata/tricouard.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dimillian/DMRESTRequest-objc/master/DMRESTRequestExample/DMRESTRequestExample.xcodeproj/project.xcworkspace/xcuserdata/tricouard.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /DMRESTRequest/DMRESTRequestTests/DMRESTRequestTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // DMRESTRequestTests.h 3 | // DMRESTRequestTests 4 | // 5 | // Created by Thomas Ricouard on 4/30/13. 6 | // Copyright (c) 2013 Thomas Ricouard. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DMRESTRequestTests : SenTestCase 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /DMRESTRequest/DMRESTRequest/NSString+TotalEscaping.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+TotalEscaping.h 3 | // MySeeen 4 | // 5 | // Created by Thomas Ricouard on 28/02/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSString (TotalEscaping) 12 | 13 | -(NSString *)stringByEscapingForURLWithString:(NSString *)string; 14 | @end 15 | -------------------------------------------------------------------------------- /DMRESTRequestExample/DMRESTRequestExample/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // DMRESTRequestExample 4 | // 5 | // Created by Thomas Ricouard on 4/30/13. 6 | // Copyright (c) 2013 Thomas Ricouard. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface ViewController : UIViewController 13 | { 14 | DMRESTRequest *_restRequest; 15 | } 16 | @end 17 | -------------------------------------------------------------------------------- /DMRESTRequestExample/DMRESTRequestExample/DMRESTRequestExample-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'DMRESTRequestExample' target in the 'DMRESTRequestExample' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_4_0 8 | #warning "This project uses features only available in iOS SDK 4.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /DMRESTRequestExample/DMRESTRequestExample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // DMRESTRequestExample 4 | // 5 | // Created by Thomas Ricouard on 4/30/13. 6 | // Copyright (c) 2013 Thomas Ricouard. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /DMRESTRequestExample/DMRESTRequestExample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // DMRESTRequestExample 4 | // 5 | // Created by Thomas Ricouard on 4/30/13. 6 | // Copyright (c) 2013 Thomas Ricouard. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class ViewController; 12 | 13 | @interface AppDelegate : UIResponder 14 | 15 | @property (strong, nonatomic) UIWindow *window; 16 | 17 | @property (strong, nonatomic) ViewController *viewController; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /DMRESTRequest.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'DMRESTRequest' 3 | s.version = '1.0.1' 4 | s.summary = 'Super simple objective-c REST request wrapper.' 5 | s.homepage = 'https://github.com/Dimillian/DMRESTRequest-objc' 6 | s.author = { 7 | 'Thomas Ricouard' => 'ricouard77@gmail.com' 8 | } 9 | s.source = { 10 | :git => 'https://github.com/Dimillian/DMRESTRequest-objc.git', 11 | :tag => '1.0.1' 12 | } 13 | s.ios.deployment_target = '6.0' 14 | s.public_header_files = 'DMRESTRequest/DMRESTRequest/*.h' 15 | s.source_files = 'DMRESTRequest/DMRESTRequest/*.{h,m}' 16 | s.requires_arc = true 17 | s.license = 'MIT' 18 | end -------------------------------------------------------------------------------- /DMRESTRequestExample/DMRESTRequestExample.xcodeproj/xcuserdata/Dimillian.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DMRESTRequestExample.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 531F2D60172FE7BD00C188C4 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /DMRESTRequestExample/DMRESTRequestExample.xcodeproj/xcuserdata/tricouard.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DMRESTRequestExample.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 531F2D60172FE7BD00C188C4 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /DMRESTRequest/DMRESTRequest.xcodeproj/xcuserdata/Dimillian.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DMRESTRequest.xcscheme 8 | 9 | orderHint 10 | 1 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 531F2D20172FE64E00C188C4 16 | 17 | primary 18 | 19 | 20 | 531F2D31172FE64E00C188C4 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /DMRESTRequest/DMRESTRequest.xcodeproj/xcuserdata/tricouard.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DMRESTRequest.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 531F2D20172FE64E00C188C4 16 | 17 | primary 18 | 19 | 20 | 531F2D31172FE64E00C188C4 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /DMRESTRequest/DMRESTRequestTests/DMRESTRequestTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | thomasricouard.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /DMRESTRequestExample/DMRESTRequestExample.xcodeproj/xcuserdata/tricouard.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2012 by Thomas Ricouard. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /DMRESTRequest/DMRESTRequest/DMJSONCache.h: -------------------------------------------------------------------------------- 1 | // 2 | // DMJSONCache.h 3 | // DMRESTRequest 4 | // 5 | // Created by Thomas Ricouard on 5/2/13. 6 | // Copyright (c) 2013 Thomas Ricouard. All rights reserved. 7 | // 8 | 9 | //This class is USED by DMRESTRequest to manage JSON cache. 10 | //It respond to memory warning and automatically clean in memory cache. 11 | //It respond firt with in memory cache, if nothing in memory it respond with disk cache. 12 | //You should not use DMJSONCache directly, you should only query static method if you want to empty cache manually 13 | //or have some information about current cache size 14 | 15 | #import 16 | 17 | @interface DMJSONCache : NSObject 18 | 19 | + (DMJSONCache *)sharedCache; 20 | 21 | - (id)cachedJSONObjectForKey:(NSString *)key; 22 | - (BOOL)cacheJSONObject:(id)object forKey:(NSString *)key; 23 | 24 | + (NSString *)generateKeyFromURLString:(NSString *)urlString; 25 | //Complety remove disk cache 26 | + (void)emptyDiskCache; 27 | //Completly remove in memory cache 28 | + (void)emptyInMemoryCache; 29 | //Size for the cache folder 30 | + (unsigned long long)diskCacheSize; 31 | @end 32 | -------------------------------------------------------------------------------- /DMRESTRequest/DMRESTRequest/NSString+TotalEscaping.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+TotalEscaping.m 3 | // MySeeen 4 | // 5 | // Created by Thomas Ricouard on 28/02/12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "NSString+TotalEscaping.h" 10 | 11 | @implementation NSString (TotalEscaping) 12 | 13 | -(NSString *)stringByEscapingForURLWithString:(NSString *)string 14 | { 15 | NSString *espacedString = [string stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; 16 | NSString *totalEscapedString = [espacedString stringByReplacingOccurrencesOfString:@"'" withString:@"%27"]; 17 | totalEscapedString = [totalEscapedString stringByReplacingOccurrencesOfString:@"+" withString:@"%2B"]; 18 | totalEscapedString = [totalEscapedString stringByReplacingOccurrencesOfString:@"&" withString:@"%26"]; 19 | totalEscapedString = [totalEscapedString stringByReplacingOccurrencesOfString:@"=" withString:@"%3D"]; 20 | totalEscapedString = [totalEscapedString stringByReplacingOccurrencesOfString:@"/" withString:@"%2F"]; 21 | totalEscapedString = [totalEscapedString stringByReplacingOccurrencesOfString:@" " withString:@"%20"]; 22 | 23 | return totalEscapedString; 24 | } 25 | @end 26 | -------------------------------------------------------------------------------- /DMRESTRequest/DMRESTRequest.xcodeproj/xcuserdata/tricouard.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 18 | 19 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /DMRESTRequestExample/DMRESTRequestExample/DMRESTRequestExample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | thomasricouard.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /DMRESTRequest/DMRESTRequest.xcodeproj/project.xcworkspace/xcshareddata/DMRESTRequest.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | CDB166F1-343A-4018-A6DB-1023B791B496 9 | IDESourceControlProjectName 10 | DMRESTRequest 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | CB910C2B-9C2F-4AA5-B064-57E74ADC6BED 14 | https://github.com/Dimillian/DMRESTRequest-objc.git 15 | 16 | IDESourceControlProjectPath 17 | DMRESTRequest/DMRESTRequest.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | CB910C2B-9C2F-4AA5-B064-57E74ADC6BED 21 | ../../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/Dimillian/DMRESTRequest-objc.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | CB910C2B-9C2F-4AA5-B064-57E74ADC6BED 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | CB910C2B-9C2F-4AA5-B064-57E74ADC6BED 36 | IDESourceControlWCCName 37 | DMRESTRequest-objc 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /DMRESTRequestExample/DMRESTRequestExample.xcworkspace/xcshareddata/DMRESTRequestExample.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | FE715FF5-40B3-4743-98AA-3E9A0A432C04 9 | IDESourceControlProjectName 10 | DMRESTRequestExample 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | CB910C2B-9C2F-4AA5-B064-57E74ADC6BED 14 | https://github.com/Dimillian/DMRESTRequest-objc.git 15 | 16 | IDESourceControlProjectPath 17 | DMRESTRequestExample/DMRESTRequestExample.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | CB910C2B-9C2F-4AA5-B064-57E74ADC6BED 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/Dimillian/DMRESTRequest-objc.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | CB910C2B-9C2F-4AA5-B064-57E74ADC6BED 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | CB910C2B-9C2F-4AA5-B064-57E74ADC6BED 36 | IDESourceControlWCCName 37 | DMRESTRequest-objc 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /DMRESTRequestExample/DMRESTRequestExample.xcodeproj/project.xcworkspace/xcshareddata/DMRESTRequestExample.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | D61A7017-D88D-4650-9B66-4BAB55DA3437 9 | IDESourceControlProjectName 10 | DMRESTRequestExample 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | C1013633-54F0-4B8B-BFCC-2DB3273A2B1F 14 | https://github.com/Dimillian/DMRESTRequest-objc.git 15 | 16 | IDESourceControlProjectPath 17 | DMRESTRequestExample/DMRESTRequestExample.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | C1013633-54F0-4B8B-BFCC-2DB3273A2B1F 21 | ../../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/Dimillian/DMRESTRequest-objc.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | C1013633-54F0-4B8B-BFCC-2DB3273A2B1F 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | C1013633-54F0-4B8B-BFCC-2DB3273A2B1F 36 | IDESourceControlWCCName 37 | DMRESTRequest-objc 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /DMRESTRequestExample/DMRESTRequestExample/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // DMRESTRequestExample 4 | // 5 | // Created by Thomas Ricouard on 4/30/13. 6 | // Copyright (c) 2013 Thomas Ricouard. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | #import "ViewController.h" 12 | 13 | @implementation AppDelegate 14 | 15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 16 | { 17 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 18 | // Override point for customization after application launch. 19 | self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil]; 20 | self.window.rootViewController = self.viewController; 21 | [self.window makeKeyAndVisible]; 22 | return YES; 23 | } 24 | 25 | - (void)applicationWillResignActive:(UIApplication *)application 26 | { 27 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 28 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 29 | } 30 | 31 | - (void)applicationDidEnterBackground:(UIApplication *)application 32 | { 33 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 34 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 35 | } 36 | 37 | - (void)applicationWillEnterForeground:(UIApplication *)application 38 | { 39 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 40 | } 41 | 42 | - (void)applicationDidBecomeActive:(UIApplication *)application 43 | { 44 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 45 | } 46 | 47 | - (void)applicationWillTerminate:(UIApplication *)application 48 | { 49 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /DMRESTRequest/DMRESTRequest.xcodeproj/xcuserdata/Dimillian.xcuserdatad/xcschemes/DMRESTRequest.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 52 | 53 | 54 | 55 | 61 | 62 | 64 | 65 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /DMRESTRequest/DMRESTRequest.xcodeproj/xcuserdata/tricouard.xcuserdatad/xcschemes/DMRESTRequest.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 52 | 53 | 54 | 55 | 61 | 62 | 64 | 65 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /DMRESTRequest/DMRESTRequest/DMRESTSettings.m: -------------------------------------------------------------------------------- 1 | // 2 | // DMRESTSettings.m 3 | // DMRestRequest 4 | // 5 | // Created by Thomas Ricouard on 4/26/13. 6 | // 7 | // 8 | 9 | #import "DMRESTSettings.h" 10 | 11 | static NSString * const kHeaderJson = @"application/json"; 12 | static NSString * const kUserAgent = @"User-Agent"; 13 | static NSString * const kHeaderFieldAccept = @"accept"; 14 | static NSString * const kHeaderFieldContentType = @"Content-Type"; 15 | static NSString * const kHeaderFieldAcceptEncoding = @"Accept-Encoding"; 16 | static NSString * const kDefaultHeaderValue = @"application/x-www-form-urlencoded"; 17 | 18 | @interface DMRESTSettings () 19 | @property (nonatomic, strong, readwrite) NSMutableDictionary *permanentHTTPHeaderFields; 20 | @property (nonatomic, strong, readwrite) NSMutableDictionary *permanentParameters; 21 | @end 22 | 23 | @implementation DMRESTSettings 24 | static DMRESTSettings *sharedSettings; 25 | 26 | +(DMRESTSettings *)sharedSettings 27 | { 28 | if (sharedSettings == nil) { 29 | sharedSettings = [[DMRESTSettings alloc]init]; 30 | } 31 | return sharedSettings; 32 | } 33 | 34 | - (id)init 35 | { 36 | self = [super init]; 37 | if (self) { 38 | _permanentHTTPHeaderFields = [[NSMutableDictionary alloc]init]; 39 | _fileExtension = nil; 40 | _sendJSON = NO; 41 | _escaping = NO; 42 | _customTimemout = 60; 43 | [self setPermanentHeaderFieldValue:kDefaultHeaderValue forHeaderField:kHeaderFieldContentType]; 44 | } 45 | return self; 46 | } 47 | 48 | - (id)initForPrivateSettingsWithBaseURL:(NSURL *)baseURL 49 | { 50 | self = [self init]; 51 | if (self) { 52 | _baseURL = baseURL; 53 | } 54 | return self; 55 | } 56 | 57 | - (id)initForPrivateSettingsFromSharedSettings 58 | { 59 | self = [DMRESTSettings sharedSettings]; 60 | if (self) { 61 | 62 | } 63 | return self; 64 | } 65 | 66 | - (void)setUserAgent:(NSString *)userAgent 67 | { 68 | _userAgent = userAgent; 69 | [self setPermanentHeaderFieldValue:userAgent forHeaderField:kUserAgent]; 70 | } 71 | 72 | - (void)setSendJSON:(BOOL)sendJSON 73 | { 74 | _sendJSON = sendJSON; 75 | if (sendJSON) { 76 | [self setPermanentHeaderFieldValue:kHeaderJson forHeaderField:kHeaderFieldContentType]; 77 | } 78 | else{ 79 | [self setPermanentHeaderFieldValue:kDefaultHeaderValue forHeaderField:kHeaderFieldContentType]; 80 | } 81 | } 82 | 83 | - (NSString *)valueForPermanentHeaderField:(NSString *)header 84 | { 85 | NSAssert(header, @"Header must not be null"); 86 | return [self.permanentHTTPHeaderFields objectForKey:header]; 87 | } 88 | 89 | - (void)setPermanentHeaderFieldValue:(NSString *)value forHeaderField:(NSString *)header 90 | { 91 | NSAssert(header, @"Header must not be null"); 92 | [self.permanentHTTPHeaderFields setValue:value forKey:header]; 93 | } 94 | 95 | - (id)valueForPermanentParameter:(NSString *)parameter 96 | { 97 | NSAssert(_permanentParameters, @"You must set at least one permanent parameter"); 98 | NSAssert(parameter, @"Parameter must not be null"); 99 | return [self.permanentParameters valueForKey:parameter]; 100 | } 101 | 102 | - (void)setPermananentParameterValue:(id)value forParameter:(NSString *)parameter 103 | { 104 | if (!_permanentParameters) { 105 | _permanentParameters = [[NSMutableDictionary alloc]init]; 106 | } 107 | NSAssert(parameter, @"parameter must not be null"); 108 | [self.permanentParameters setValue:value forKey:parameter]; 109 | } 110 | 111 | 112 | @end 113 | -------------------------------------------------------------------------------- /DMRESTRequestExample/DMRESTRequestExample.xcodeproj/xcuserdata/Dimillian.xcuserdatad/xcschemes/DMRESTRequestExample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 51 | 52 | 58 | 59 | 60 | 61 | 62 | 63 | 69 | 70 | 76 | 77 | 78 | 79 | 81 | 82 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /DMRESTRequestExample/DMRESTRequestExample.xcodeproj/xcuserdata/tricouard.xcuserdatad/xcschemes/DMRESTRequestExample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 51 | 52 | 58 | 59 | 60 | 61 | 62 | 63 | 69 | 70 | 76 | 77 | 78 | 79 | 81 | 82 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /DMRESTRequest/DMRESTRequestTests/DMRESTRequestTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // DMRESTRequestTest.m 3 | // DMRESTRequestTest 4 | // 5 | // Created by Thomas Ricouard on 27/04/13. 6 | // 7 | // 8 | 9 | #import "DMRESTRequestTests.h" 10 | #import "DMRESTRequest.h" 11 | 12 | @implementation DMRESTRequestTests 13 | 14 | - (void)setUp 15 | { 16 | [super setUp]; 17 | 18 | // Set-up code here. 19 | } 20 | 21 | - (void)tearDown 22 | { 23 | // Tear-down code here. 24 | 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testSettingsPrivacy 29 | { 30 | DMRESTSettings *privateSharedSetting = [[DMRESTSettings alloc]initForPrivateSettingsFromSharedSettings]; 31 | STAssertEqualObjects(@"http://google.com", 32 | privateSharedSetting.baseURL.absoluteString, 33 | @"FAILURE: Base URL should be equal shared settings one"); 34 | DMRESTSettings *privateprivateSettings = [[DMRESTSettings alloc]initForPrivateSettingsWithBaseURL: 35 | [NSURL URLWithString:@"http://helloworld.com"]]; 36 | [privateprivateSettings setFileExtension:@"xml"]; 37 | STAssertEqualObjects(@"http://helloworld.com", 38 | privateprivateSettings.baseURL.absoluteString, 39 | @"FAILURE: base URL not equal"); 40 | STAssertEqualObjects(@"xml", 41 | privateprivateSettings.fileExtension, 42 | @"FAILURE: File extension not equal"); 43 | } 44 | 45 | - (void)testSettingsPermanent 46 | { 47 | [[DMRESTSettings sharedSettings]setPermanentHeaderFieldValue:@"test" 48 | forHeaderField:@"headerTest"]; 49 | STAssertEqualObjects(@"test", [[DMRESTSettings sharedSettings] 50 | valueForPermanentHeaderField:@"headerTest"], 51 | @"FAILURE"); 52 | [[DMRESTSettings sharedSettings]setPermanentHeaderFieldValue:nil forHeaderField:@"headerTest"]; 53 | STAssertNil([[DMRESTSettings sharedSettings]valueForPermanentHeaderField:@"headerTest"], @"FAILURE"); 54 | 55 | [[DMRESTSettings sharedSettings]setPermananentParameterValue:@"test" forParameter:@"paramTest"]; 56 | STAssertEqualObjects(@"test", [[DMRESTSettings sharedSettings]valueForPermanentParameter:@"paramTest"], @"FAILURE"); 57 | [[DMRESTSettings sharedSettings]setPermananentParameterValue:nil forParameter:@"paramTest"]; 58 | STAssertNil([[DMRESTSettings sharedSettings]valueForPermanentParameter:@"paramTest"], @"FAILURE"); 59 | } 60 | 61 | - (void)testSettingsUserAgent 62 | { 63 | [[DMRESTSettings sharedSettings]setUserAgent:@"test"]; 64 | STAssertEquals(@"test", [[DMRESTSettings sharedSettings]userAgent], @"FAILURE"); 65 | STAssertEquals(@"test", [[DMRESTSettings sharedSettings]valueForPermanentHeaderField:@"User-Agent"], @"FAILURE"); 66 | [[DMRESTSettings sharedSettings]setUserAgent:nil]; 67 | STAssertNil([[DMRESTSettings sharedSettings]userAgent], @"FAILURE"); 68 | STAssertFalse([[[DMRESTSettings sharedSettings]valueForPermanentHeaderField:@"User-Agent"] 69 | isEqualToString:@"test"], 70 | @"FAILURE"); 71 | } 72 | 73 | - (void)testRequest 74 | { 75 | [[DMRESTSettings sharedSettings]setBaseURL:[NSURL URLWithString:@"http://google.com"]]; 76 | [[DMRESTSettings sharedSettings]setFileExtension:@"json"]; 77 | STAssertEqualObjects(@"http://google.com", 78 | [[[DMRESTSettings sharedSettings]baseURL]absoluteString], 79 | @"FAILURE: Base URL not properly set"); 80 | STAssertEqualObjects(@"json", 81 | [[DMRESTSettings sharedSettings]fileExtension], 82 | @"FAILURE: File extension not properly set"); 83 | } 84 | 85 | @end 86 | -------------------------------------------------------------------------------- /DMRESTRequest/DMRESTRequest/DMRESTSettings.h: -------------------------------------------------------------------------------- 1 | // 2 | // DMRESTSettings.h 3 | // DMRestRequest 4 | // 5 | // Created by Thomas Ricouard on 4/26/13. 6 | // 7 | // 8 | 9 | #import 10 | 11 | /** 12 | DMRESTSettings define the settings shared between your DMRESTRequest instances 13 | Some properties are required some other not 14 | Your must set baseURL before executing any request 15 | */ 16 | @interface DMRESTSettings : NSObject 17 | 18 | /** 19 | the base URL of all your request, must be set before doing a request 20 | */ 21 | @property (nonatomic, strong) NSURL *baseURL; 22 | /** 23 | the file extension of your endpoint (.json, .xml, .php etc...) 24 | Appended at the end of your ressource if you set one. 25 | */ 26 | @property (nonatomic, copy) NSString *fileExtension; 27 | 28 | /** 29 | The user agent to use for your DMRESTRequest 30 | If nil the default user agent is used 31 | The user agent is added to your HTTP header field and merged with your other custom fields 32 | If you set it to nil the default uset agant is set 33 | */ 34 | @property (nonatomic, copy) NSString *userAgent; 35 | 36 | /** 37 | The timeout the request should wait before throwing an error. 38 | Default value is 60 seconds (Think of Edge) 39 | */ 40 | @property (nonatomic) NSTimeInterval customTimemout; 41 | /** 42 | Define if parameters should be converted to JSON format (or not) before executing the request 43 | Ignored for GET request, parameters will be added in the URL 44 | Add the JSON header field, will be merged with your other permanent header field. 45 | Default is NO 46 | */ 47 | @property (nonatomic, getter = isSendJSON) BOOL sendJSON; 48 | 49 | /** 50 | Indicate if DMRESTRequest should escape or not your parameters 51 | Default is NO 52 | */ 53 | @property (nonatomic, getter = isEscaping) BOOL escaping; 54 | 55 | 56 | @property (nonatomic, strong, readonly) NSMutableDictionary *permanentHTTPHeaderFields; 57 | @property (nonatomic, strong, readonly) NSMutableDictionary *permanentParameters; 58 | 59 | /** 60 | Designated singleton access to set and access the shared settings 61 | This singleton is used for all your DMRESTRequest if you don't set privateCustomSettings property to them 62 | */ 63 | +(DMRESTSettings *)sharedSettings; 64 | 65 | /** 66 | Initiliazer if you don't want to use shared settings 67 | Create an instance of this class and set it to the privateCustomSettings field of your DMRESTRequest 68 | It will prevent it to use the shared settings but use the passed settings instead 69 | Will not copy current shared settings when created 70 | */ 71 | -(id)initForPrivateSettingsWithBaseURL:(NSURL *)baseURL; 72 | /** 73 | Initiliazer if you want to create private settings for a specific DMRESTRequest 74 | Will copy current shared settings when created 75 | */ 76 | -(id)initForPrivateSettingsFromSharedSettings; 77 | 78 | /** 79 | @return The value of the passed header field, nil if no header value set for the passed header 80 | */ 81 | - (NSString *)valueForPermanentHeaderField:(NSString *)header; 82 | /** 83 | Set the value for the passed header field 84 | Header fields will be used to every request you make with shared settings 85 | @param value The value, the header field will be removed if the value passed is nil 86 | @param header The header field of the value 87 | */ 88 | - (void)setPermanentHeaderFieldValue:(NSString *)value forHeaderField:(NSString *)header; 89 | /** 90 | @return The value of the passed paramener, nil if no paramener value set for the passed parameter 91 | */ 92 | - (id)valueForPermanentParameter:(NSString *)parameter; 93 | /** 94 | Set the value for the passed parameter. 95 | Permanent parameters will be added to every request you make with shared settings 96 | It is a good place to set your auth token for example 97 | @param value The value, the parameter will be removed if the value passed is nil 98 | @param parameter The parameter of the value 99 | */ 100 | - (void)setPermananentParameterValue:(id)value forParameter:(NSString *)parameter; 101 | @end 102 | -------------------------------------------------------------------------------- /DMRESTRequest/DMRESTRequest/DMJSONCache.m: -------------------------------------------------------------------------------- 1 | // 2 | // DMJSONCache.m 3 | // DMRESTRequest 4 | // 5 | // Created by Thomas Ricouard on 5/2/13. 6 | // Copyright (c) 2013 Thomas Ricouard. All rights reserved. 7 | // 8 | 9 | #import "DMJSONCache.h" 10 | #import 11 | 12 | static NSString * const kCacheFolderName = @"DMRESTRequestCachedJSON"; 13 | 14 | @interface DMJSONCache () 15 | 16 | - (void)receivedMemoryWarning; 17 | - (NSString *)filePath; 18 | - (NSString *)fullFilePathForFilename:(NSString *)filename; 19 | - (void)createCacheFolderIfNotExist; 20 | 21 | @property (nonatomic, strong) NSCache *inMemoryCache; 22 | @end 23 | 24 | @implementation DMJSONCache 25 | 26 | static DMJSONCache *sharedCache; 27 | 28 | - (id)init 29 | { 30 | self = [super init]; 31 | if (self) { 32 | _inMemoryCache = [[NSCache alloc]init]; 33 | [[NSNotificationCenter defaultCenter]addObserver:self 34 | selector:@selector(receivedMemoryWarning) 35 | name:UIApplicationDidReceiveMemoryWarningNotification 36 | object:nil]; 37 | [self createCacheFolderIfNotExist]; 38 | } 39 | return self; 40 | } 41 | 42 | + (DMJSONCache *)sharedCache 43 | { 44 | if (sharedCache == nil) { 45 | sharedCache = [[DMJSONCache alloc]init]; 46 | } 47 | return sharedCache; 48 | } 49 | 50 | - (BOOL)cacheJSONObject:(id)object forKey:(NSString *)key 51 | { 52 | [self.inMemoryCache setObject:object forKey:key]; 53 | dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul); 54 | dispatch_async(queue, ^{ 55 | NSOutputStream *opt = [NSOutputStream outputStreamToFileAtPath:[self fullFilePathForFilename:key] append:NO]; 56 | [opt open]; 57 | [NSJSONSerialization writeJSONObject:object toStream:opt options:0 error:nil]; 58 | [opt close]; 59 | }); 60 | return YES; 61 | } 62 | 63 | - (id)cachedJSONObjectForKey:(NSString *)key 64 | { 65 | if ([self.inMemoryCache objectForKey:key]) { 66 | return [self.inMemoryCache objectForKey:key]; 67 | } 68 | else if ([self isFileExistForFilename:key]){ 69 | NSInputStream *input = [NSInputStream inputStreamWithFileAtPath:[self fullFilePathForFilename:key]]; 70 | [input open]; 71 | NSError *readError = nil; 72 | id result = [NSJSONSerialization JSONObjectWithStream:input options:NSJSONReadingAllowFragments error:&readError]; 73 | [input close]; 74 | if (result && !readError) { 75 | [self.inMemoryCache setObject:result forKey:key]; 76 | return result; 77 | } 78 | } 79 | else{ 80 | return nil; 81 | } 82 | return nil; 83 | } 84 | 85 | #pragma mark - disk cache management 86 | 87 | - (NSString *)filePath 88 | { 89 | NSArray *paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES); 90 | NSString *libraryDirectory = [paths objectAtIndex:0]; 91 | return [libraryDirectory stringByAppendingPathComponent:kCacheFolderName]; 92 | 93 | } 94 | 95 | - (NSString *)fullFilePathForFilename:(NSString *)filename 96 | { 97 | return [[self filePath] stringByAppendingPathComponent:filename]; 98 | } 99 | 100 | - (BOOL)isFileExistForFilename:(NSString *)filename 101 | { 102 | return [[NSFileManager defaultManager]fileExistsAtPath:[self fullFilePathForFilename:filename]]; 103 | } 104 | 105 | - (void)createCacheFolderIfNotExist 106 | { 107 | if (![[NSFileManager defaultManager]fileExistsAtPath:[self filePath]]) { 108 | NSError *fileError; 109 | [[NSFileManager defaultManager]createDirectoryAtPath:[self filePath] 110 | withIntermediateDirectories:NO 111 | attributes:nil 112 | error:&fileError]; 113 | } 114 | } 115 | 116 | #pragma mark - memory management 117 | - (void)receivedMemoryWarning 118 | { 119 | [self.inMemoryCache removeAllObjects]; 120 | } 121 | 122 | #pragma mark - static method 123 | 124 | + (NSString *)generateKeyFromURLString:(NSString *)urlString 125 | { 126 | NSString *filename = [urlString stringByReplacingOccurrencesOfString:@"/" withString:@""]; 127 | filename = [filename stringByReplacingOccurrencesOfString:@"&" withString:@""]; 128 | filename = [filename stringByReplacingOccurrencesOfString:@"=" withString:@""]; 129 | return filename; 130 | } 131 | 132 | + (void)emptyDiskCache 133 | { 134 | [[NSFileManager defaultManager]removeItemAtPath:[[DMJSONCache sharedCache]filePath] 135 | error:nil]; 136 | [[DMJSONCache sharedCache]createCacheFolderIfNotExist]; 137 | } 138 | 139 | + (void)emptyInMemoryCache 140 | { 141 | [[[DMJSONCache sharedCache]inMemoryCache]removeAllObjects]; 142 | } 143 | 144 | + (unsigned long long)diskCacheSize 145 | { 146 | NSDictionary *fileAttributes = [[NSFileManager defaultManager]attributesOfItemAtPath:[[DMJSONCache sharedCache]filePath] 147 | error:nil]; 148 | return [fileAttributes fileSize]; 149 | } 150 | 151 | @end 152 | -------------------------------------------------------------------------------- /DMRESTRequestExample/DMRESTRequestExample/en.lproj/ViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1536 5 | 12A269 6 | 2835 7 | 1187 8 | 624.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 1919 12 | 13 | 14 | IBProxyObject 15 | IBUIView 16 | 17 | 18 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 19 | 20 | 21 | PluginDependencyRecalculationVersion 22 | 23 | 24 | 25 | 26 | IBFilesOwner 27 | IBCocoaTouchFramework 28 | 29 | 30 | IBFirstResponder 31 | IBCocoaTouchFramework 32 | 33 | 34 | 35 | 274 36 | {{0, 20}, {320, 548}} 37 | 38 | 39 | 40 | 41 | 3 42 | MC43NQA 43 | 44 | 2 45 | 46 | 47 | NO 48 | 49 | 50 | IBUIScreenMetrics 51 | 52 | YES 53 | 54 | 55 | 56 | 57 | 58 | {320, 568} 59 | {568, 320} 60 | 61 | 62 | IBCocoaTouchFramework 63 | Retina 4 Full Screen 64 | 2 65 | 66 | IBCocoaTouchFramework 67 | 68 | 69 | 70 | 71 | 72 | 73 | view 74 | 75 | 76 | 77 | 7 78 | 79 | 80 | 81 | 82 | 83 | 0 84 | 85 | 86 | 87 | 88 | 89 | -1 90 | 91 | 92 | File's Owner 93 | 94 | 95 | -2 96 | 97 | 98 | 99 | 100 | 6 101 | 102 | 103 | 104 | 105 | 106 | 107 | ViewController 108 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 109 | UIResponder 110 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 111 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 112 | 113 | 114 | 115 | 116 | 117 | 7 118 | 119 | 120 | 121 | 122 | ViewController 123 | UIViewController 124 | 125 | IBProjectSource 126 | ./Classes/ViewController.h 127 | 128 | 129 | 130 | 131 | 0 132 | IBCocoaTouchFramework 133 | YES 134 | 3 135 | YES 136 | 1919 137 | 138 | 139 | -------------------------------------------------------------------------------- /DMRESTRequest/DMRESTRequest/DMRESTRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // DMRESTRequest.h 3 | // 4 | // Created by Thomas Ricouard on 29/02/12. 5 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 6 | // 7 | 8 | #import 9 | #import "DMRESTSettings.h" 10 | 11 | @class DMRESTHTTPAuthCredential; 12 | @protocol DMRESTRequestDelegate; 13 | 14 | typedef void (^DMResponseBlock)(NSURLResponse *response, NSInteger HTTPStatusCode, long long exeptedLength); 15 | typedef void (^DMProgressBlock)(NSMutableData *completeData, NSData *newData, NSUInteger newDataLength); 16 | typedef void (^DMConnectionErrorBlock)(NSError *error); 17 | typedef void (^DMCompletionBlock)(NSData *data); 18 | typedef void (^DMFullCompletionBlock)(NSURLResponse *response, NSData *data, NSError *error, BOOL success); 19 | typedef void (^DMJSONCacheCompletionBlock)(NSURLResponse *response, id JSONObject, NSError *error, BOOL success, BOOL fromCache); 20 | typedef DMRESTHTTPAuthCredential *(^DMHTTPAuthBlock)(void); 21 | 22 | /** 23 | DMRESTRequest is here to manage REST request easily within your application 24 | */ 25 | @interface DMRESTRequest : NSObject 26 | 27 | /** 28 | The delegate, provide various feedback when you adopt the protocol and set the delegate 29 | You don't need it if you only use block methods 30 | */ 31 | @property (nonatomic, weak) id delegate; 32 | 33 | /** 34 | Set this property to use the passed settings instead of the shared settings 35 | If not set it will use the DMRESTSettings sharedSettings settings you've set. 36 | */ 37 | @property (nonatomic, strong) DMRESTSettings *privateCustomSettings; 38 | 39 | /** 40 | Designated initializer, init a new standard DMRESTRequest object 41 | @param method The HTTP method, GET/POST/PUT/DELETE/Custom... 42 | @param ressource The ressource targeted for this request, as the endpoint is a constant, just provide the targeted ressource. Ie: user/new 43 | @param parameters A dictionnary containing the parameters to send in the request 44 | @returns aAnew initialized object 45 | */ 46 | -(id)initWithMethod:(NSString *)method 47 | ressource:(NSString *)ressource 48 | parameters:(NSDictionary *)parameters; 49 | 50 | /** 51 | Execute a standard request using block, provide inline response, data and error 52 | */ 53 | -(void)executeBlockRequest:(DMFullCompletionBlock)completionBlock; 54 | 55 | 56 | /** 57 | Note: YOU SOULD Really use this method if you are working with a JSON API. 58 | Special method, call the completionBlock twice, once with cached result (from memory or disk), one with result from your request 59 | Only work with API return JSON type data. 60 | Automatically cache the JSON at the end of the request. 61 | Cached result are only used for GET request, also the callback will not be called twice if no cache is present 62 | @param option The NSJSONReadingOption will be used when creating the JSON object from received data 63 | */ 64 | -(void)executeJSONBlockRequestWithCache:(BOOL)useCache 65 | JSONReadingOption:(NSJSONReadingOptions)option 66 | completion:(DMJSONCacheCompletionBlock)completionBlock; 67 | 68 | /** 69 | Execute a standard request using block, provide inline response, data and error 70 | Also provide a block that let you a chance to provide you own HTTPAUth Credential 71 | */ 72 | -(void)executeBlockRequest:(DMFullCompletionBlock)completionBlock 73 | requestAskforHTTPAuth:(DMHTTPAuthBlock)httpAuthBlock; 74 | 75 | /** 76 | Execute a standard request using block, provide different callback as block, it emulate delegate but with block 77 | responseBlock: Called first, contain the response, http status code and exepted content size 78 | httpAuthBlock: Called when the request need credential for HTTP auth, you can return nil 79 | progressBlock: Called multiple time during the request, provide the data downloaded so far and the % of progression 80 | errorBlock: Called when the request fail with an error 81 | completionBlock: Called once the request is done, provide complete data 82 | */ 83 | -(void)executeDetailedBlockRequestReceivedResponse:(DMResponseBlock)responseBlock 84 | requestAskforHTTPAuth:(DMHTTPAuthBlock)httpAuthBlock 85 | progressWithReceivedData:(DMProgressBlock)progressBlock 86 | failedWithError:(DMConnectionErrorBlock)errorBlock 87 | finishedRequest:(DMCompletionBlock)completionBlock; 88 | 89 | /** 90 | Execute the request using delegate, you must set the delegate before calling this method 91 | */ 92 | -(void)executeRequestWithDelegate; 93 | 94 | /** 95 | Cancel the current request 96 | */ 97 | -(void)cancelRequest; 98 | @end 99 | 100 | /** 101 | DMRESTHTTPAuthLogin is a simple object providing an interface to forward credential when DMRESTRequest 102 | ask for them 103 | */ 104 | @interface DMRESTHTTPAuthCredential : NSObject 105 | 106 | @property (nonatomic, copy, readonly) NSString *login; 107 | @property (nonatomic, copy, readonly) NSString *password; 108 | @property (nonatomic, readonly) BOOL continueLogin; 109 | 110 | /** 111 | Init a new DMRESTHTTPAuthLogin 112 | @param user The username for the HTTP auth credential 113 | @param password The password for the HTTP auth credential 114 | @param login should login or not, set YES if you want to relaunch the DMRESTRequest and login with pssed 115 | credential 116 | @return A new initialized object 117 | */ 118 | - (id)initWithLogin:(NSString *)login 119 | password:(NSString *)password 120 | continueLogin:(BOOL)continueLogin; 121 | @end 122 | 123 | 124 | /** 125 | The protocol you should conform and implement if you want to use the delegate feedback of DMRESTRequest 126 | */ 127 | @protocol DMRESTRequestDelegate 128 | @required 129 | /** 130 | Called as soon as the request start, usefull to display a loading screen or something 131 | */ 132 | -(void)requestDidStart; 133 | 134 | /** 135 | Called as soon as the request finished loading with a JSON response 136 | @param json A NSJSONSerialization initialized object containing the request response 137 | */ 138 | -(void)requestDidFinishWithJSON:(NSJSONSerialization *)json; 139 | 140 | /** 141 | Called when the request fail with en error 142 | @param error The error contaning the code and description 143 | */ 144 | -(void)requestDidFailWithError:(NSError *)error; 145 | @optional 146 | /** 147 | Called when the request have the HTTP status code 148 | @param status The HTTP status code returned by the server 149 | */ 150 | -(void)requestDidRespondWithHTTPStatus:(NSInteger)status; 151 | 152 | /** 153 | Called when the request finish loading with data, use this when you don't want JSON but the actual non formatted data 154 | returned by the server 155 | @param data The data returned by the server. 156 | */ 157 | -(void)requestDidFinishWithData:(NSMutableData *)data; 158 | 159 | /** 160 | Called when the request fail because no active internet connection is present on the device 161 | */ 162 | -(void)requestDidFailBecauseNoActiveConnection; 163 | 164 | @end 165 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # DMRESTRequest 2 | ## Overview 3 | **DMRESTRequest** is a super simple wrapper around **NSURLConnection** and **NSMutableRequest**. 4 | It's allow you to launch REST Requests to your server in 2 line, literally. 5 | 6 | **DMRESTRequest** built using **ARC** and targeted for iOS 5 and later. It's build as a **static library** so it's very easy to link it with your project. 7 | 8 | This is not a framework nor a complete solution like RESTKit is. 9 | 10 | **DMRESTRequest** is a utility I wrote mostly because all other frameworks was doing too much for my need. It is aim to do simple REST Request to a server without object mapping and queuing. 11 | 12 | ## Features 13 | 1. Support 2 way of executing a request, using block or delegate. 14 | 2. Super simple to instantiate, you have to pass the **HTTP** method you want to use, the targeted **ressource** and the **parameters** as a dictionary `key=value` 15 | 3. The class take care of building the appropriate request and the parameters data. 16 | 4. Response trough block (also works with delegate) method when no active internet connection is available. No Reachbility needed. 17 | 5. Work with the status bar activity indicator. 18 | 6. I've wrote a little category to encode the parameters string in UTF-8 and escape it. It is included as **DMRESTRequest** use it. 19 | 7. Automatic parameters converstion to JSON format for HTTPBody if needed. 20 | 8. Basic HTTP auth support. 21 | 9. By default you share your settings between requests, but you can also set custom settings for a specific requests 22 | 23 | ## What you should know before using it 24 | 25 | ###DMRESTSettings 26 | `DMRESTSettings` manage settings shared between your `DMRESTRequest` instances. 27 | You set them once (before any request) and then they are used for every other requests. 28 | The minimum to set is the `baseURL` 29 | You set them like this 30 | 31 | [[DMRESTSettings sharedSettings]setBaseURL:[NSURL URLWithString:@"https://api.virtual-info.info/"]]; 32 | [[DMRESTSettings sharedSettings]setFileExtension:@"json"]; 33 | 34 | You can also set an instance of `DMRESTSettings` for a specific requests, so you can prevent this requests to use the shared settings 35 | Take a look at the initializer of `DMRESTSettings` 36 | 37 | -(id)initForPrivateSettingsWithBaseURL:(NSURL *)baseURL; 38 | 39 | 40 | And then set it to the property `privateCustomSettings` of `DMRESTRequest`. 41 | 42 | Use the singleton `[DMRESTSettings sharedSettings`] to set shared settings. 43 | 44 | ###JSON and Cache 45 | If your API send back JSON data type you should really take look at this speficic method for executing your requests. 46 | 47 | -(void)executeJSONBlockRequestWithCache:(BOOL)useCache 48 | JSONReadingOption:(NSJSONReadingOptions)option 49 | completion:(DMJSONCacheCompletionBlock)completionBlock; 50 | 51 | It automaticcaly cache the response and send you back JSON object (NSDictionnary or NSArray). The completion block is called twice if a cached response is found. Once with the cached result, and once with the respone from the server 52 | 53 | `DMRESTRequest` provide a cache service, `DMJSONCache`, it should not be used alone. `DMRESTRequest` use it automatically when you execute request with the methode above. `DMJSONCache` provide some methods if you want to clean the in memory cache or the disk one. The in memory store respond to memory warning and will be automatically free if one is received. 54 | 55 | ###Timeout 56 | Default `Timeout` interval is 60 seconds You can you can set: 57 | 58 | `[[DMRESTSettings sharedSettings]setCustomTimemout:30];` 59 | 60 | ###Sending parameters as JSON 61 | For automatic parameters conversion to JSON format for HTTPBody just set `[[DMRESTSettings sharedSettings]setSendJSON:YES]` before executing the request. 62 | It will automagically convert your parameters to a JSON string and set the HTTP stuff like `application/json`. 63 | 64 | ###HTTP header fields 65 | The standard HTTP content-type is hardcoded to `application/x-www-form-urlencoded`, you're free to make it dynamic if you need a custom one. But for most/all of your requests it should works. (It's set to `application/json` if you send params as JSON). 66 | 67 | 68 | ###Parmanent HTTP header fields 69 | You can add custom Permanent HTTP header fields with the `DMRESTSettings` method 70 | `- (void)setPermanentHeaderFieldValue:(NSString *)value forHeaderField:(NSString *)header;` 71 | 72 | ###Permanent parameters 73 | You can add permanent parameters such as a Auth Token with the `DMRESTSettings` method 74 | `- (void)setPermananentParameterValue:(id)value forParameter:(NSString *)parameter;` 75 | 76 | ## Getting started 77 | 78 | ###Cocoapods 79 | 80 | Just add `pod 'DMRESTRequest'` to your podfile 81 | 82 | ###Run the example 83 | 84 | Run `pod install` in the Example folder 85 | 86 | ###Manual 87 | 88 | Drag the `DMRESTRequest.xcodeproj` from the Finder to your openned project. 89 | 90 | In the build phase of your target, in the **"target dependencies"** add `DMRESTRequest`, and in the **"Link binary with library"** add `libDMRESTRequest.a`. 91 | 92 | Now in the build settings of your target set the **Always search user paths** to `YES` and add to the **User header search paths** this : `$(PROJECT_TEMP_DIR)/../UninstalledProducts/include` 93 | 94 | Import `#import ` where you want to use it and you're done! 95 | 96 | ## Code example 97 | You will find more detailled examples in the project... 98 | 99 | ### using block based methods 100 | 101 | //Block bsed method, short method without using the delegate. 102 | DMRESTRequest *blockrestRequest = [[DMRESTRequest alloc]initWithMethod:@"GET" 103 | ressource:@"self" 104 | parameters:@{@"user": @"Dimillian"}]; 105 | [blockrestRequest executeBlockRequest:^(NSURLResponse *response, NSData *data, NSError *error, BOOL success){ 106 | if (error || !success) { 107 | //TODO show error message 108 | } 109 | else{ 110 | NSJSONSerialization *json = [NSJSONSerialization JSONObjectWithData:data 111 | options:NSJSONReadingAllowFragments 112 | error:nil]; 113 | NSLog(@"%@", json); 114 | //TODO do something with response 115 | } 116 | }]; 117 | 118 | 119 | `DMRESTRequest` also provide 2 other block based methods 120 | One which provide a chance to provide HTTP auth credentials 121 | 122 | 123 | -(void)executeBlockRequest:(void (^)(NSURLResponse *response, NSData *data, NSError *error, BOOL success))handler 124 | requestAskforHTTPAuth:(DMRESTHTTPAuthCredential *(^)(void))httpAuthBlock; 125 | 126 | It also provide a complexe block based methods which simulate delegate and provide a lot of feedbacks. 127 | Useful for tracking progress of a request 128 | 129 | -(void)executeDetailedBlockRequestReceivedResponse:(void (^)(NSURLResponse *response, 130 | NSInteger httpStatusCode, 131 | float exeptedContentSize))responseBlock 132 | requestAskforHTTPAuth:(DMRESTHTTPAuthCredential *(^)(void))httpAuthBlock 133 | progressWithReceivedData:(void (^)(NSData *currentData, NSData *newData, float currentSize))progressBlock 134 | failedWithError:(void(^)(NSError *error))errorBlock 135 | finishedRequest:(void(^)(NSData *completeData))completionBlock; 136 | 137 | 138 | ### using delegate 139 | 140 | [restRequest setDelegate:self]; 141 | [restRequest executeRequestWithDelegate]; 142 | 143 | -(void)requestDidStart 144 | { 145 | 146 | } 147 | 148 | -(void)requestDidRespondWithHTTPStatus:(NSInteger)status 149 | { 150 | 151 | } 152 | 153 | -(void)requestDidFinishWithJSON:(NSJSONSerialization *)json 154 | { 155 | 156 | } 157 | 158 | -(void)requestDidFailWithError:(NSError *)error 159 | { 160 | 161 | } 162 | 163 | -(void)requestDidFailBecauseNoActiveConnection 164 | { 165 | 166 | } 167 | 168 | -(void)requestCredentialIncorrectForHTTPAuth 169 | { 170 | 171 | } 172 | 173 | ###Cancel a request 174 | [restRequest cancelRequest]; 175 | 176 | 177 | ## Licensing 178 | Copyright (C) 2013 by Thomas Ricouard. 179 | 180 | Permission is hereby granted, free of charge, to any person obtaining a copy 181 | of this software and associated documentation files (the "Software"), to deal 182 | in the Software without restriction, including without limitation the rights 183 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 184 | copies of the Software, and to permit persons to whom the Software is 185 | furnished to do so, subject to the following conditions: 186 | 187 | The above copyright notice and this permission notice shall be included in 188 | all copies or substantial portions of the Software. 189 | 190 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 191 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 192 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 193 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 194 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 195 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 196 | THE SOFTWARE. 197 | -------------------------------------------------------------------------------- /DMRESTRequestExample/DMRESTRequestExample/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // DMRESTRequestExample 4 | // 5 | // Created by Thomas Ricouard on 4/30/13. 6 | // Copyright (c) 2013 Thomas Ricouard. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import 11 | 12 | @interface ViewController () 13 | 14 | @end 15 | 16 | @implementation ViewController 17 | 18 | - (void)viewDidLoad 19 | { 20 | [super viewDidLoad]; 21 | [[DMRESTSettings sharedSettings]setBaseURL:[NSURL URLWithString:@"https://api.virtual-info.info"]]; 22 | [[DMRESTSettings sharedSettings]setFileExtension:@"json"]; 23 | //Adding some permanent parameter like a AuthToken 24 | [[DMRESTSettings sharedSettings]setPermananentParameterValue:@"1234" forParameter:@"AuthToken"]; 25 | NSLog(@"%@", [[DMRESTSettings sharedSettings]valueForPermanentParameter:@"AuthToken"]); 26 | 27 | [self simpleCachedJSONBlockRequest]; 28 | [self simpleBlockRequest]; 29 | [self complexeBlockRequest]; 30 | [self privateSettingsBlockRequest]; 31 | [self httpAuthBlockRequest]; 32 | [self delegateRequest]; 33 | 34 | // Do any additional setup after loading the view, typically from a nib. 35 | } 36 | 37 | - (void)simpleBlockRequest 38 | { 39 | 40 | //Block method, short method without using the delegate. 41 | //This is the preferred way 42 | DMRESTRequest *blockrestRequest = [[DMRESTRequest alloc]initWithMethod:@"GET" 43 | ressource:@"self" 44 | parameters:@{@"user": @"Dimillian"}]; 45 | [blockrestRequest executeBlockRequest:^(NSURLResponse *response, NSData *data, NSError *error, BOOL success){ 46 | if (error || !success) { 47 | //TODO show error message 48 | } 49 | else{ 50 | NSJSONSerialization *json = [NSJSONSerialization JSONObjectWithData:data 51 | options:NSJSONReadingAllowFragments 52 | error:nil]; 53 | NSLog(@"%@", json); 54 | //TODO do something with response 55 | } 56 | }]; 57 | } 58 | 59 | - (void)simpleCachedJSONBlockRequest 60 | { 61 | //Simple block JSON request when you are sure that your API return JSON, DMRESTRequest take care of returnin a JSONObject which can be a 62 | //NSDictionnary or a NSArray 63 | DMRESTRequest *request = [[DMRESTRequest alloc]initWithMethod:@"GET" 64 | ressource:@"self" 65 | parameters:@{@"user": @"dimillian"}]; 66 | [request executeJSONBlockRequestWithCache:YES 67 | JSONReadingOption:NSJSONReadingAllowFragments 68 | completion:^(NSURLResponse *response, id JSONObject, NSError *error, BOOL success, BOOL fromCache) { 69 | NSDictionary *jsonDic = (NSDictionary *)JSONObject; 70 | if (fromCache) { 71 | NSLog(@"CACHED JSON: %@", jsonDic); 72 | } 73 | else{ 74 | NSLog(@"SERVER JSON: %@", jsonDic); 75 | 76 | } 77 | 78 | }]; 79 | } 80 | 81 | - (void)complexeBlockRequest 82 | { 83 | //Complexe block usage 84 | //Provide more feedback with more detail 85 | DMRESTRequest *complexeBlockRequest = [[DMRESTRequest alloc]initWithMethod:@"POST" 86 | ressource:@"self" 87 | parameters:@{@"user": @"Dimillian", @"query": @"full"}]; 88 | 89 | [complexeBlockRequest executeDetailedBlockRequestReceivedResponse:^(NSURLResponse *response, NSInteger httpStatusCode, long long exeptedContentSize) { 90 | 91 | } requestAskforHTTPAuth:^DMRESTHTTPAuthCredential *{ 92 | return nil; 93 | } progressWithReceivedData:^(NSMutableData *currentData, NSData *newData, NSUInteger currentSize) { 94 | NSLog(@"%lu", (unsigned long)currentSize); 95 | } failedWithError:^(NSError *error) { 96 | NSLog(@"%@", error); 97 | } finishedRequest:^(NSData *completeData) { 98 | NSJSONSerialization *json = [NSJSONSerialization JSONObjectWithData:completeData 99 | options:NSJSONReadingAllowFragments 100 | error:nil]; 101 | NSLog(@"%@", json); 102 | }]; 103 | 104 | } 105 | 106 | 107 | - (void)privateSettingsBlockRequest 108 | { 109 | //Example with custom setting for this request, send HTTPBody as JSON 110 | DMRESTSettings *settings = [[DMRESTSettings alloc]initForPrivateSettingsFromSharedSettings]; 111 | [settings setSendJSON:YES]; 112 | [settings setUserAgent:@"DMRESTRequest/version type/JSON"]; 113 | DMRESTRequest *postRequest = [[DMRESTRequest alloc]initWithMethod:@"POST" 114 | ressource:@"self" 115 | parameters:@{@"user": @"dimillian", 116 | @"movies": [NSNumber numberWithInt:1]}]; 117 | [postRequest setPrivateCustomSettings:settings]; 118 | [postRequest executeBlockRequest:^(NSURLResponse *response, NSData *data, NSError *error, BOOL success) { 119 | if (success) { 120 | NSJSONSerialization *json = [NSJSONSerialization JSONObjectWithData:data 121 | options:NSJSONReadingAllowFragments 122 | error:nil]; 123 | NSLog(@"%@", json); 124 | } 125 | }]; 126 | } 127 | 128 | - (void)httpAuthBlockRequest 129 | { 130 | //Other example using simple block method with HTTP auth 131 | DMRESTSettings *authSettings = [[DMRESTSettings alloc]initForPrivateSettingsWithBaseURL: 132 | [NSURL URLWithString:@"http://auth.api.virtual-info.info/"]]; 133 | DMRESTRequest *authRequest = [[DMRESTRequest alloc]initWithMethod:@"GET" ressource:@"" parameters:nil]; 134 | [authRequest setPrivateCustomSettings:authSettings]; 135 | [authRequest executeBlockRequest:^(NSURLResponse *response, NSData *data, NSError *error, BOOL success) { 136 | NSLog(@"%@", response); 137 | NSString *string = [[NSString alloc]initWithData:data encoding:NSUTF8StringEncoding]; 138 | NSLog(@"%@", string); 139 | } requestAskforHTTPAuth:^DMRESTHTTPAuthCredential *{ 140 | NSLog(@"ASK LOGIn"); 141 | DMRESTHTTPAuthCredential *login = [[DMRESTHTTPAuthCredential alloc]initWithLogin:@"azerty" password:@"azerty" continueLogin:YES]; 142 | return login; 143 | }]; 144 | } 145 | 146 | - (void)delegateRequest 147 | { 148 | 149 | 150 | //Other example with multiple parameters and other properties and using delegate 151 | _restRequest = [[DMRESTRequest alloc]initWithMethod:@"POST" 152 | ressource:@"users" 153 | parameters: 154 | [NSDictionary dictionaryWithObjectsAndKeys:@"13", @"userId", @"Dimillian", @"username", nil]]; 155 | DMRESTSettings *privateSettings = [[DMRESTSettings alloc]initForPrivateSettingsWithBaseURL: 156 | [NSURL URLWithString:@"http://google.com"]]; 157 | [privateSettings setFileExtension:@"json"]; 158 | privateSettings.customTimemout = 40; 159 | privateSettings.sendJSON = YES; 160 | [_restRequest setDelegate:self]; 161 | [_restRequest executeRequestWithDelegate]; 162 | } 163 | 164 | - (void)viewDidUnload 165 | { 166 | [super viewDidUnload]; 167 | // Release any retained subviews of the main view. 168 | } 169 | 170 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 171 | { 172 | return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); 173 | } 174 | 175 | 176 | #pragma mark - DMRestRequest delegate 177 | 178 | -(void)requestDidStart 179 | { 180 | NSLog(@"START"); 181 | //The request just started, you should start your loading screen or something 182 | } 183 | 184 | -(void)requestDidRespondWithHTTPStatus:(NSInteger)status 185 | { 186 | NSLog(@"STATUS %d", status); 187 | //Useful if you rely on HTTP status code on your client to do some opérations. 188 | //This delegate will be called first after requestDidStart. 189 | 190 | //ie if(status==200) OK 191 | } 192 | 193 | -(void)requestDidFinishWithJSON:(NSJSONSerialization *)json 194 | { 195 | 196 | NSLog(@"JSON %@", json); 197 | //Request is finished with success and you have the full JSON response from your server. 198 | //The response can be an NSDictionnary or an NSArray (mutable). 199 | 200 | //ie: NSDictionary *jsonDic = (NSDictionary*)json; 201 | 202 | //This is where you can parse it into your model object and start doing some crazy shit 203 | } 204 | 205 | -(void)requestDidFailWithError:(NSError *)error 206 | { 207 | //Request did fail with an error, check the error to know why and refresh your UI. 208 | } 209 | 210 | -(void)requestDidFailBecauseNoActiveConnection 211 | { 212 | //No active connection detected 213 | //you should display en error message 214 | } 215 | 216 | -(void)requestCredentialIncorrectForHTTPAuth 217 | { 218 | //Crendential provided incorect 219 | } 220 | 221 | 222 | @end 223 | -------------------------------------------------------------------------------- /DMRESTRequest/DMRESTRequest/DMRESTRequest.m: -------------------------------------------------------------------------------- 1 | // 2 | // DMRESTRequest.m 3 | // 4 | // Created by Thomas Ricouard on 29/02/12. 5 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 6 | // 7 | 8 | #import "DMRESTRequest.h" 9 | #import "NSString+TotalEscaping.h" 10 | #import 11 | #import "DMJSONCache.h" 12 | 13 | @interface DMRESTRequest () 14 | { 15 | NSMutableData *_responseData; 16 | NSURLConnection *_connection; 17 | NSURLResponse *_urlResponse; 18 | NSError *_error; 19 | BOOL _success; 20 | long long _contentSize; 21 | NSUInteger _currentSize; 22 | BOOL _isCancelled; 23 | } 24 | 25 | -(NSMutableURLRequest *)constructRequest; 26 | -(NSURL *)getURL; 27 | -(NSString *)constructParametersString; 28 | -(NSData *)parametersToJSON; 29 | 30 | @property (nonatomic, copy) DMResponseBlock responseBlock; 31 | @property (nonatomic, copy) DMProgressBlock progressBlock; 32 | @property (nonatomic, copy) DMConnectionErrorBlock errorBlock; 33 | @property (nonatomic, copy) DMCompletionBlock completionBlock; 34 | @property (nonatomic, copy) DMHTTPAuthBlock httpAuthBlock; 35 | @property (nonatomic, copy) DMFullCompletionBlock fullCompletionBlock; 36 | @property (nonatomic, copy) DMJSONCacheCompletionBlock jsonCacheCompletionBlock; 37 | 38 | @property (nonatomic, readonly) DMRESTSettings *inUseSettings; 39 | @property (nonatomic, strong) NSString *method; 40 | @property (nonatomic, strong) NSString *ressource; 41 | @property (nonatomic, strong) NSDictionary *parameters; 42 | @end 43 | 44 | @implementation DMRESTRequest 45 | 46 | -(id)initWithMethod:(NSString *)method 47 | ressource:(NSString *)ressource 48 | parameters:(NSDictionary *)parameters 49 | { 50 | self = [super init]; 51 | if (self) { 52 | _method = method; 53 | _ressource = ressource; 54 | _parameters = parameters; 55 | _contentSize = 0; 56 | _currentSize = 0; 57 | _isCancelled = NO; 58 | } 59 | return self; 60 | } 61 | 62 | -(DMRESTSettings *)inUseSettings 63 | { 64 | if (_privateCustomSettings) { 65 | return _privateCustomSettings; 66 | } 67 | return [DMRESTSettings sharedSettings]; 68 | } 69 | 70 | 71 | -(NSMutableURLRequest *)constructRequest 72 | { 73 | NSAssert(self.inUseSettings.baseURL, @"You must set a baseURL"); 74 | NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init]; 75 | [request setTimeoutInterval:self.inUseSettings.customTimemout]; 76 | if ([_method isEqualToString:@"GET"]) { 77 | [request setURL:[self getURL]]; 78 | } 79 | else { 80 | if (self.inUseSettings.fileExtension) { 81 | [request setURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/%@.%@", 82 | self.inUseSettings.baseURL.absoluteString, 83 | _ressource, 84 | self.inUseSettings.fileExtension]]]; 85 | } 86 | else{ 87 | [request setURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/%@", 88 | self.inUseSettings.baseURL.absoluteString, 89 | _ressource]]]; 90 | } 91 | [request setHTTPMethod:_method]; 92 | if (![self.inUseSettings isSendJSON]) { 93 | NSData *data = [[self constructParametersString]dataUsingEncoding:NSUTF8StringEncoding 94 | allowLossyConversion:YES]; 95 | NSString *length = [NSString stringWithFormat:@"%d", [data length]]; 96 | [request setValue:length forHTTPHeaderField:@"Content-Length"]; 97 | [request setHTTPBody:data]; 98 | } 99 | else { 100 | NSData *jsonParameters = [self parametersToJSON]; 101 | NSString *length = [NSString stringWithFormat:@"%d", jsonParameters.length]; 102 | [request setValue:length forHTTPHeaderField:@"Content-Length"]; 103 | [request setHTTPBody:jsonParameters]; 104 | } 105 | [self.inUseSettings.permanentHTTPHeaderFields enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { 106 | NSString *stringKey = (NSString *)key; 107 | NSString *value = (NSString *)obj; 108 | [request setValue:value forHTTPHeaderField:stringKey]; 109 | }]; 110 | 111 | } 112 | return request; 113 | } 114 | 115 | -(NSURL *)getURL 116 | { 117 | NSString *fileExt; 118 | if (self.inUseSettings.fileExtension) { 119 | fileExt = [NSString stringWithFormat:@".%@", self.inUseSettings.fileExtension]; 120 | } 121 | else{ 122 | fileExt = @""; 123 | } 124 | return [NSURL URLWithString: 125 | [NSString stringWithFormat:@"%@/%@%@?%@", 126 | self.inUseSettings.baseURL.absoluteString, 127 | _ressource, 128 | fileExt, 129 | [self constructParametersString]]]; 130 | } 131 | 132 | -(NSString *)constructParametersString 133 | { 134 | __block NSString *parametersString = [[NSString alloc]init]; 135 | if (_parameters) { 136 | [_parameters enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { 137 | if (self.inUseSettings.isEscaping) { 138 | if ([obj isKindOfClass:[NSString class]]) { 139 | NSString *string = (NSString *)obj; 140 | NSString *escapedParameter = [string stringByEscapingForURLWithString:string]; 141 | parametersString = [parametersString stringByAppendingFormat:@"%@=%@&", key, escapedParameter]; 142 | } 143 | else{ 144 | parametersString = [parametersString stringByAppendingFormat:@"%@=%@&", key, obj]; 145 | } 146 | } 147 | else{ 148 | parametersString = [parametersString stringByAppendingFormat:@"%@=%@&", key, obj]; 149 | } 150 | }]; 151 | } 152 | if (self.inUseSettings.permanentParameters) { 153 | [self.inUseSettings.permanentParameters enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { 154 | parametersString = [parametersString stringByAppendingFormat:@"%@=%@&", key, obj]; 155 | }]; 156 | } 157 | 158 | parametersString = [parametersString stringByReplacingOccurrencesOfString:@"%3D" withString:@"="]; 159 | if ([parametersString length] > 0) { 160 | parametersString = [parametersString substringToIndex:[parametersString length] - 1]; 161 | } 162 | 163 | if (!_parameters && !self.inUseSettings.permanentParameters) { 164 | parametersString = @""; 165 | } 166 | 167 | return parametersString; 168 | } 169 | 170 | -(NSData *)parametersToJSON 171 | { 172 | NSError *error = nil; 173 | __block NSMutableDictionary *finalParameters = [[NSMutableDictionary alloc]init]; 174 | [_parameters enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { 175 | [finalParameters setObject:obj forKey:key]; 176 | }]; 177 | if (self.inUseSettings.permanentParameters) { 178 | [self.inUseSettings.permanentParameters enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { 179 | [finalParameters setObject:obj forKey:key]; 180 | }]; 181 | } 182 | return [NSJSONSerialization dataWithJSONObject:finalParameters 183 | options:NSJSONWritingPrettyPrinted 184 | error:&error]; 185 | } 186 | 187 | -(void)executeBlockRequest:(DMFullCompletionBlock)completionBlock 188 | { 189 | dispatch_async(dispatch_get_main_queue(), ^{ 190 | [UIApplication sharedApplication].networkActivityIndicatorVisible = YES; 191 | }); 192 | [NSURLConnection sendAsynchronousRequest:[self constructRequest] 193 | queue:[NSOperationQueue currentQueue] 194 | completionHandler:^(NSURLResponse *res, NSData *data, NSError *error){ 195 | dispatch_async(dispatch_get_main_queue(), ^{ 196 | [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; 197 | }); 198 | if (error.code == -1009 || _isCancelled) { 199 | _isCancelled = NO; 200 | completionBlock(res, data, error, NO); 201 | } 202 | else{ 203 | completionBlock(res, data, error, YES); 204 | } 205 | }]; 206 | } 207 | 208 | 209 | -(void)executeJSONBlockRequestWithCache:(BOOL)useCache 210 | JSONReadingOption:(NSJSONReadingOptions)option 211 | completion:(DMJSONCacheCompletionBlock)completionBlock 212 | { 213 | dispatch_async(dispatch_get_main_queue(), ^{ 214 | [UIApplication sharedApplication].networkActivityIndicatorVisible = YES; 215 | }); 216 | NSString *fileName = [DMJSONCache generateKeyFromURLString:[[self getURL]absoluteString]]; 217 | if ([_method isEqualToString:@"GET"] && useCache) { 218 | id cachedObject = [[DMJSONCache sharedCache]cachedJSONObjectForKey:fileName]; 219 | if (cachedObject) { 220 | completionBlock(nil, cachedObject, nil, YES, YES); 221 | } 222 | } 223 | [NSURLConnection sendAsynchronousRequest:[self constructRequest] 224 | queue:[NSOperationQueue currentQueue] 225 | completionHandler:^(NSURLResponse *res, NSData *data, NSError *error){ 226 | dispatch_async(dispatch_get_main_queue(), ^{ 227 | [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; 228 | }); 229 | if (error.code == -1009 || _isCancelled) { 230 | _isCancelled = NO; 231 | completionBlock(res, nil, error, NO, NO); 232 | } 233 | else{ 234 | if (data) { 235 | NSError *jsonError = nil; 236 | id jsonObject = [NSJSONSerialization JSONObjectWithData:data 237 | options:option 238 | error:&jsonError]; 239 | if (!error && jsonObject) { 240 | if (useCache) { 241 | [[DMJSONCache sharedCache]cacheJSONObject:jsonObject forKey:fileName]; 242 | } 243 | completionBlock(res, jsonObject, nil, YES, NO); 244 | } 245 | else{ 246 | completionBlock(res, nil, jsonError, NO, NO); 247 | } 248 | } 249 | else{ 250 | completionBlock(res, nil, nil, NO, NO); 251 | } 252 | } 253 | 254 | }]; 255 | 256 | } 257 | 258 | - (void)executeBlockRequest:(DMFullCompletionBlock)completionBlock 259 | requestAskforHTTPAuth:(DMHTTPAuthBlock)httpAuthBlock 260 | { 261 | _fullCompletionBlock = completionBlock; 262 | _httpAuthBlock = httpAuthBlock; 263 | _responseData = [[NSMutableData alloc] init]; 264 | _connection = [[NSURLConnection alloc] initWithRequest:[self constructRequest] delegate:self]; 265 | } 266 | 267 | - (void)executeDetailedBlockRequestReceivedResponse:(DMResponseBlock)responseBlock 268 | requestAskforHTTPAuth:(DMHTTPAuthBlock)httpAuthBlock 269 | progressWithReceivedData:(DMProgressBlock)progressBlock 270 | failedWithError:(DMConnectionErrorBlock)errorBlock 271 | finishedRequest:(DMCompletionBlock)completionBlock 272 | { 273 | _completionBlock = completionBlock; 274 | _errorBlock = errorBlock; 275 | _responseBlock = responseBlock; 276 | _progressBlock = progressBlock; 277 | _httpAuthBlock = httpAuthBlock; 278 | _responseData = [[NSMutableData alloc] init]; 279 | _connection = [[NSURLConnection alloc] initWithRequest:[self constructRequest] delegate:self]; 280 | } 281 | 282 | - (void)executeRequestWithDelegate 283 | { 284 | dispatch_async(dispatch_get_main_queue(), ^{ 285 | [UIApplication sharedApplication].networkActivityIndicatorVisible = YES; 286 | }); 287 | _connection = [[NSURLConnection alloc] initWithRequest:[self constructRequest] delegate:self]; 288 | if (_connection) { 289 | _responseData = [[NSMutableData alloc] init]; 290 | [self.delegate requestDidStart]; 291 | } 292 | } 293 | 294 | -(void)cancelRequest 295 | { 296 | [_connection cancel]; 297 | _connection = nil; 298 | _responseData = nil; 299 | dispatch_async(dispatch_get_main_queue(), ^{ 300 | [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; 301 | }); 302 | _currentSize = 0; 303 | _contentSize = 0; 304 | _isCancelled = YES; 305 | } 306 | 307 | 308 | #pragma mark - NSURLConnection Delegate 309 | - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { 310 | [_responseData setLength:0]; 311 | _urlResponse = response; 312 | NSHTTPURLResponse* httpResponse = (NSHTTPURLResponse*)response; 313 | NSInteger responseStatusCode = [httpResponse statusCode]; 314 | if (_responseBlock) { 315 | _contentSize = [response expectedContentLength]; 316 | _currentSize = 0; 317 | _responseBlock(response, responseStatusCode, _contentSize); 318 | } 319 | if ([self.delegate respondsToSelector:@selector(requestDidRespondWithHTTPStatus:)]) { 320 | [self.delegate requestDidRespondWithHTTPStatus:responseStatusCode]; 321 | } 322 | } 323 | 324 | - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { 325 | [_responseData appendData:data]; 326 | if (_progressBlock) { 327 | _currentSize += [data length]; 328 | _progressBlock(_responseData, data, _currentSize); 329 | } 330 | } 331 | 332 | - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { 333 | if ([error code] == -1009) { 334 | if ([self.delegate respondsToSelector:@selector(requestDidFailBecauseNoActiveConnection)]) { 335 | [self.delegate requestDidFailBecauseNoActiveConnection]; 336 | } 337 | } 338 | if ([self.delegate respondsToSelector:@selector(requestDidFailWithError:)]) { 339 | [self.delegate requestDidFailWithError:error]; 340 | } 341 | if (_errorBlock) { 342 | _errorBlock(error); 343 | } 344 | _error = error; 345 | _success = NO; 346 | dispatch_async(dispatch_get_main_queue(), ^{ 347 | [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; 348 | }); 349 | } 350 | 351 | - (void)connectionDidFinishLoading:(NSURLConnection *)connection { 352 | 353 | _success = YES; 354 | if(_completionBlock){ 355 | _completionBlock(_responseData); 356 | } 357 | if (_fullCompletionBlock) { 358 | if (_isCancelled) { 359 | _isCancelled = NO; 360 | _fullCompletionBlock(_urlResponse, _responseData, _error, NO); 361 | } 362 | else{ 363 | _fullCompletionBlock(_urlResponse, _responseData, _error, _success); 364 | } 365 | } 366 | 367 | if ([self.delegate respondsToSelector:@selector(requestDidFinishWithData:)]) { 368 | [self.delegate requestDidFinishWithData:_responseData]; 369 | } 370 | 371 | if ([self.delegate respondsToSelector:@selector(requestDidFinishWithJSON:)]) { 372 | NSError *jsonError; 373 | NSJSONSerialization *json = [NSJSONSerialization JSONObjectWithData:_responseData 374 | options:NSJSONReadingAllowFragments 375 | error:&jsonError]; 376 | if (!jsonError && json) { 377 | [self.delegate requestDidFinishWithJSON:json]; 378 | } 379 | } 380 | dispatch_async(dispatch_get_main_queue(), ^{ 381 | [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; 382 | }); 383 | } 384 | 385 | 386 | #pragma mark - HTTP auth 387 | 388 | 389 | -(void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge 390 | { 391 | DMRESTHTTPAuthCredential *auth = _httpAuthBlock(); 392 | if (auth.login && auth.password && auth.continueLogin) { 393 | NSURLCredential *credential = [[NSURLCredential alloc]initWithUser:auth.login 394 | password:auth.password 395 | persistence:NSURLCredentialPersistenceForSession]; 396 | 397 | [[challenge sender]useCredential:credential forAuthenticationChallenge:challenge]; 398 | } 399 | else if (!auth.continueLogin){ 400 | [[challenge sender]cancelAuthenticationChallenge:challenge]; 401 | [self cancelRequest]; 402 | _fullCompletionBlock(_urlResponse, nil, _error, NO); 403 | } 404 | } 405 | 406 | - (BOOL)connectionShouldUseCredentialStorage:(NSURLConnection *)connection 407 | { 408 | return NO; 409 | } 410 | 411 | @end 412 | 413 | @interface DMRESTHTTPAuthCredential () 414 | @property (nonatomic, copy, readwrite) NSString *login; 415 | @property (nonatomic, copy, readwrite) NSString *password; 416 | @property (nonatomic, readwrite) BOOL continueLogin; 417 | @end 418 | 419 | @implementation DMRESTHTTPAuthCredential 420 | 421 | - (id)initWithLogin:(NSString *)login password:(NSString *)password continueLogin:(BOOL)continueLogin 422 | { 423 | self = [super init]; 424 | if (self) { 425 | _login = login; 426 | _password = password; 427 | _continueLogin = continueLogin; 428 | } 429 | return self; 430 | } 431 | 432 | @end 433 | -------------------------------------------------------------------------------- /DMRESTRequest/DMRESTRequest.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 531F2D25172FE64E00C188C4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 531F2D24172FE64E00C188C4 /* Foundation.framework */; }; 11 | 531F2D2A172FE64E00C188C4 /* DMRESTRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 531F2D29172FE64E00C188C4 /* DMRESTRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; 12 | 531F2D2C172FE64E00C188C4 /* DMRESTRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 531F2D2B172FE64E00C188C4 /* DMRESTRequest.m */; }; 13 | 531F2D34172FE64E00C188C4 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 531F2D33172FE64E00C188C4 /* SenTestingKit.framework */; }; 14 | 531F2D37172FE64E00C188C4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 531F2D24172FE64E00C188C4 /* Foundation.framework */; }; 15 | 531F2D3A172FE64E00C188C4 /* libDMRESTRequest.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 531F2D21172FE64E00C188C4 /* libDMRESTRequest.a */; }; 16 | 531F2D40172FE64E00C188C4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 531F2D3E172FE64E00C188C4 /* InfoPlist.strings */; }; 17 | 531F2D43172FE64E00C188C4 /* DMRESTRequestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 531F2D42172FE64E00C188C4 /* DMRESTRequestTests.m */; }; 18 | 531F2D50172FE66400C188C4 /* DMRESTSettings.m in Sources */ = {isa = PBXBuildFile; fileRef = 531F2D4D172FE66400C188C4 /* DMRESTSettings.m */; }; 19 | 531F2D51172FE66400C188C4 /* NSString+TotalEscaping.m in Sources */ = {isa = PBXBuildFile; fileRef = 531F2D4F172FE66400C188C4 /* NSString+TotalEscaping.m */; }; 20 | 531F2D54172FE6D600C188C4 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 531F2D53172FE6D600C188C4 /* UIKit.framework */; }; 21 | 531F2D57172FE76F00C188C4 /* DMRESTSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = 531F2D4C172FE66400C188C4 /* DMRESTSettings.h */; settings = {ATTRIBUTES = (Public, ); }; }; 22 | 53A70F4F1732990E0015779D /* DMJSONCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 53A70F4D1732990E0015779D /* DMJSONCache.h */; settings = {ATTRIBUTES = (Public, ); }; }; 23 | 53A70F501732990E0015779D /* DMJSONCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 53A70F4E1732990E0015779D /* DMJSONCache.m */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXContainerItemProxy section */ 27 | 531F2D38172FE64E00C188C4 /* PBXContainerItemProxy */ = { 28 | isa = PBXContainerItemProxy; 29 | containerPortal = 531F2D19172FE64E00C188C4 /* Project object */; 30 | proxyType = 1; 31 | remoteGlobalIDString = 531F2D20172FE64E00C188C4; 32 | remoteInfo = DMRESTRequest; 33 | }; 34 | /* End PBXContainerItemProxy section */ 35 | 36 | /* Begin PBXFileReference section */ 37 | 531F2D21172FE64E00C188C4 /* libDMRESTRequest.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libDMRESTRequest.a; sourceTree = BUILT_PRODUCTS_DIR; }; 38 | 531F2D24172FE64E00C188C4 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 39 | 531F2D28172FE64E00C188C4 /* DMRESTRequest-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "DMRESTRequest-Prefix.pch"; sourceTree = ""; }; 40 | 531F2D29172FE64E00C188C4 /* DMRESTRequest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DMRESTRequest.h; sourceTree = ""; }; 41 | 531F2D2B172FE64E00C188C4 /* DMRESTRequest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DMRESTRequest.m; sourceTree = ""; }; 42 | 531F2D32172FE64E00C188C4 /* DMRESTRequestTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DMRESTRequestTests.octest; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 531F2D33172FE64E00C188C4 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; }; 44 | 531F2D3D172FE64E00C188C4 /* DMRESTRequestTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "DMRESTRequestTests-Info.plist"; sourceTree = ""; }; 45 | 531F2D3F172FE64E00C188C4 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 46 | 531F2D41172FE64E00C188C4 /* DMRESTRequestTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DMRESTRequestTests.h; sourceTree = ""; }; 47 | 531F2D42172FE64E00C188C4 /* DMRESTRequestTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DMRESTRequestTests.m; sourceTree = ""; }; 48 | 531F2D4C172FE66400C188C4 /* DMRESTSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DMRESTSettings.h; sourceTree = ""; }; 49 | 531F2D4D172FE66400C188C4 /* DMRESTSettings.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DMRESTSettings.m; sourceTree = ""; }; 50 | 531F2D4E172FE66400C188C4 /* NSString+TotalEscaping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+TotalEscaping.h"; sourceTree = ""; }; 51 | 531F2D4F172FE66400C188C4 /* NSString+TotalEscaping.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+TotalEscaping.m"; sourceTree = ""; }; 52 | 531F2D53172FE6D600C188C4 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 53 | 53A70F4D1732990E0015779D /* DMJSONCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DMJSONCache.h; path = ../../DMRestRequest/DMRESTRequest/DMJSONCache.h; sourceTree = ""; }; 54 | 53A70F4E1732990E0015779D /* DMJSONCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DMJSONCache.m; path = ../../DMRestRequest/DMRESTRequest/DMJSONCache.m; sourceTree = ""; }; 55 | /* End PBXFileReference section */ 56 | 57 | /* Begin PBXFrameworksBuildPhase section */ 58 | 531F2D1E172FE64E00C188C4 /* Frameworks */ = { 59 | isa = PBXFrameworksBuildPhase; 60 | buildActionMask = 2147483647; 61 | files = ( 62 | 531F2D54172FE6D600C188C4 /* UIKit.framework in Frameworks */, 63 | 531F2D25172FE64E00C188C4 /* Foundation.framework in Frameworks */, 64 | ); 65 | runOnlyForDeploymentPostprocessing = 0; 66 | }; 67 | 531F2D2E172FE64E00C188C4 /* Frameworks */ = { 68 | isa = PBXFrameworksBuildPhase; 69 | buildActionMask = 2147483647; 70 | files = ( 71 | 531F2D34172FE64E00C188C4 /* SenTestingKit.framework in Frameworks */, 72 | 531F2D37172FE64E00C188C4 /* Foundation.framework in Frameworks */, 73 | 531F2D3A172FE64E00C188C4 /* libDMRESTRequest.a in Frameworks */, 74 | ); 75 | runOnlyForDeploymentPostprocessing = 0; 76 | }; 77 | /* End PBXFrameworksBuildPhase section */ 78 | 79 | /* Begin PBXGroup section */ 80 | 531F2D18172FE64E00C188C4 = { 81 | isa = PBXGroup; 82 | children = ( 83 | 531F2D26172FE64E00C188C4 /* DMRESTRequest */, 84 | 531F2D3B172FE64E00C188C4 /* DMRESTRequestTests */, 85 | 531F2D23172FE64E00C188C4 /* Frameworks */, 86 | 531F2D22172FE64E00C188C4 /* Products */, 87 | ); 88 | sourceTree = ""; 89 | }; 90 | 531F2D22172FE64E00C188C4 /* Products */ = { 91 | isa = PBXGroup; 92 | children = ( 93 | 531F2D21172FE64E00C188C4 /* libDMRESTRequest.a */, 94 | 531F2D32172FE64E00C188C4 /* DMRESTRequestTests.octest */, 95 | ); 96 | name = Products; 97 | sourceTree = ""; 98 | }; 99 | 531F2D23172FE64E00C188C4 /* Frameworks */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | 531F2D53172FE6D600C188C4 /* UIKit.framework */, 103 | 531F2D24172FE64E00C188C4 /* Foundation.framework */, 104 | 531F2D33172FE64E00C188C4 /* SenTestingKit.framework */, 105 | ); 106 | name = Frameworks; 107 | sourceTree = ""; 108 | }; 109 | 531F2D26172FE64E00C188C4 /* DMRESTRequest */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | 531F2D52172FE66C00C188C4 /* categories */, 113 | 531F2D29172FE64E00C188C4 /* DMRESTRequest.h */, 114 | 531F2D2B172FE64E00C188C4 /* DMRESTRequest.m */, 115 | 531F2D4C172FE66400C188C4 /* DMRESTSettings.h */, 116 | 531F2D4D172FE66400C188C4 /* DMRESTSettings.m */, 117 | 53A70F4D1732990E0015779D /* DMJSONCache.h */, 118 | 53A70F4E1732990E0015779D /* DMJSONCache.m */, 119 | 531F2D27172FE64E00C188C4 /* Supporting Files */, 120 | ); 121 | path = DMRESTRequest; 122 | sourceTree = ""; 123 | }; 124 | 531F2D27172FE64E00C188C4 /* Supporting Files */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | 531F2D28172FE64E00C188C4 /* DMRESTRequest-Prefix.pch */, 128 | ); 129 | name = "Supporting Files"; 130 | sourceTree = ""; 131 | }; 132 | 531F2D3B172FE64E00C188C4 /* DMRESTRequestTests */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | 531F2D41172FE64E00C188C4 /* DMRESTRequestTests.h */, 136 | 531F2D42172FE64E00C188C4 /* DMRESTRequestTests.m */, 137 | 531F2D3C172FE64E00C188C4 /* Supporting Files */, 138 | ); 139 | path = DMRESTRequestTests; 140 | sourceTree = ""; 141 | }; 142 | 531F2D3C172FE64E00C188C4 /* Supporting Files */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | 531F2D3D172FE64E00C188C4 /* DMRESTRequestTests-Info.plist */, 146 | 531F2D3E172FE64E00C188C4 /* InfoPlist.strings */, 147 | ); 148 | name = "Supporting Files"; 149 | sourceTree = ""; 150 | }; 151 | 531F2D52172FE66C00C188C4 /* categories */ = { 152 | isa = PBXGroup; 153 | children = ( 154 | 531F2D4E172FE66400C188C4 /* NSString+TotalEscaping.h */, 155 | 531F2D4F172FE66400C188C4 /* NSString+TotalEscaping.m */, 156 | ); 157 | name = categories; 158 | sourceTree = ""; 159 | }; 160 | /* End PBXGroup section */ 161 | 162 | /* Begin PBXHeadersBuildPhase section */ 163 | 531F2D55172FE76900C188C4 /* Headers */ = { 164 | isa = PBXHeadersBuildPhase; 165 | buildActionMask = 2147483647; 166 | files = ( 167 | 531F2D57172FE76F00C188C4 /* DMRESTSettings.h in Headers */, 168 | 531F2D2A172FE64E00C188C4 /* DMRESTRequest.h in Headers */, 169 | 53A70F4F1732990E0015779D /* DMJSONCache.h in Headers */, 170 | ); 171 | runOnlyForDeploymentPostprocessing = 0; 172 | }; 173 | /* End PBXHeadersBuildPhase section */ 174 | 175 | /* Begin PBXNativeTarget section */ 176 | 531F2D20172FE64E00C188C4 /* DMRESTRequest */ = { 177 | isa = PBXNativeTarget; 178 | buildConfigurationList = 531F2D46172FE64E00C188C4 /* Build configuration list for PBXNativeTarget "DMRESTRequest" */; 179 | buildPhases = ( 180 | 531F2D1D172FE64E00C188C4 /* Sources */, 181 | 531F2D1E172FE64E00C188C4 /* Frameworks */, 182 | 531F2D55172FE76900C188C4 /* Headers */, 183 | ); 184 | buildRules = ( 185 | ); 186 | dependencies = ( 187 | ); 188 | name = DMRESTRequest; 189 | productName = DMRESTRequest; 190 | productReference = 531F2D21172FE64E00C188C4 /* libDMRESTRequest.a */; 191 | productType = "com.apple.product-type.library.static"; 192 | }; 193 | 531F2D31172FE64E00C188C4 /* DMRESTRequestTests */ = { 194 | isa = PBXNativeTarget; 195 | buildConfigurationList = 531F2D49172FE64E00C188C4 /* Build configuration list for PBXNativeTarget "DMRESTRequestTests" */; 196 | buildPhases = ( 197 | 531F2D2D172FE64E00C188C4 /* Sources */, 198 | 531F2D2E172FE64E00C188C4 /* Frameworks */, 199 | 531F2D2F172FE64E00C188C4 /* Resources */, 200 | 531F2D30172FE64E00C188C4 /* ShellScript */, 201 | ); 202 | buildRules = ( 203 | ); 204 | dependencies = ( 205 | 531F2D39172FE64E00C188C4 /* PBXTargetDependency */, 206 | ); 207 | name = DMRESTRequestTests; 208 | productName = DMRESTRequestTests; 209 | productReference = 531F2D32172FE64E00C188C4 /* DMRESTRequestTests.octest */; 210 | productType = "com.apple.product-type.bundle"; 211 | }; 212 | /* End PBXNativeTarget section */ 213 | 214 | /* Begin PBXProject section */ 215 | 531F2D19172FE64E00C188C4 /* Project object */ = { 216 | isa = PBXProject; 217 | attributes = { 218 | LastUpgradeCheck = 0460; 219 | ORGANIZATIONNAME = "Thomas Ricouard"; 220 | }; 221 | buildConfigurationList = 531F2D1C172FE64E00C188C4 /* Build configuration list for PBXProject "DMRESTRequest" */; 222 | compatibilityVersion = "Xcode 3.2"; 223 | developmentRegion = English; 224 | hasScannedForEncodings = 0; 225 | knownRegions = ( 226 | en, 227 | ); 228 | mainGroup = 531F2D18172FE64E00C188C4; 229 | productRefGroup = 531F2D22172FE64E00C188C4 /* Products */; 230 | projectDirPath = ""; 231 | projectRoot = ""; 232 | targets = ( 233 | 531F2D20172FE64E00C188C4 /* DMRESTRequest */, 234 | 531F2D31172FE64E00C188C4 /* DMRESTRequestTests */, 235 | ); 236 | }; 237 | /* End PBXProject section */ 238 | 239 | /* Begin PBXResourcesBuildPhase section */ 240 | 531F2D2F172FE64E00C188C4 /* Resources */ = { 241 | isa = PBXResourcesBuildPhase; 242 | buildActionMask = 2147483647; 243 | files = ( 244 | 531F2D40172FE64E00C188C4 /* InfoPlist.strings in Resources */, 245 | ); 246 | runOnlyForDeploymentPostprocessing = 0; 247 | }; 248 | /* End PBXResourcesBuildPhase section */ 249 | 250 | /* Begin PBXShellScriptBuildPhase section */ 251 | 531F2D30172FE64E00C188C4 /* ShellScript */ = { 252 | isa = PBXShellScriptBuildPhase; 253 | buildActionMask = 2147483647; 254 | files = ( 255 | ); 256 | inputPaths = ( 257 | ); 258 | outputPaths = ( 259 | ); 260 | runOnlyForDeploymentPostprocessing = 0; 261 | shellPath = /bin/sh; 262 | shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; 263 | }; 264 | /* End PBXShellScriptBuildPhase section */ 265 | 266 | /* Begin PBXSourcesBuildPhase section */ 267 | 531F2D1D172FE64E00C188C4 /* Sources */ = { 268 | isa = PBXSourcesBuildPhase; 269 | buildActionMask = 2147483647; 270 | files = ( 271 | 531F2D2C172FE64E00C188C4 /* DMRESTRequest.m in Sources */, 272 | 531F2D50172FE66400C188C4 /* DMRESTSettings.m in Sources */, 273 | 531F2D51172FE66400C188C4 /* NSString+TotalEscaping.m in Sources */, 274 | 53A70F501732990E0015779D /* DMJSONCache.m in Sources */, 275 | ); 276 | runOnlyForDeploymentPostprocessing = 0; 277 | }; 278 | 531F2D2D172FE64E00C188C4 /* Sources */ = { 279 | isa = PBXSourcesBuildPhase; 280 | buildActionMask = 2147483647; 281 | files = ( 282 | 531F2D43172FE64E00C188C4 /* DMRESTRequestTests.m in Sources */, 283 | ); 284 | runOnlyForDeploymentPostprocessing = 0; 285 | }; 286 | /* End PBXSourcesBuildPhase section */ 287 | 288 | /* Begin PBXTargetDependency section */ 289 | 531F2D39172FE64E00C188C4 /* PBXTargetDependency */ = { 290 | isa = PBXTargetDependency; 291 | target = 531F2D20172FE64E00C188C4 /* DMRESTRequest */; 292 | targetProxy = 531F2D38172FE64E00C188C4 /* PBXContainerItemProxy */; 293 | }; 294 | /* End PBXTargetDependency section */ 295 | 296 | /* Begin PBXVariantGroup section */ 297 | 531F2D3E172FE64E00C188C4 /* InfoPlist.strings */ = { 298 | isa = PBXVariantGroup; 299 | children = ( 300 | 531F2D3F172FE64E00C188C4 /* en */, 301 | ); 302 | name = InfoPlist.strings; 303 | sourceTree = ""; 304 | }; 305 | /* End PBXVariantGroup section */ 306 | 307 | /* Begin XCBuildConfiguration section */ 308 | 531F2D44172FE64E00C188C4 /* Debug */ = { 309 | isa = XCBuildConfiguration; 310 | buildSettings = { 311 | ALWAYS_SEARCH_USER_PATHS = NO; 312 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 313 | CLANG_CXX_LIBRARY = "libc++"; 314 | CLANG_ENABLE_OBJC_ARC = YES; 315 | CLANG_WARN_CONSTANT_CONVERSION = YES; 316 | CLANG_WARN_EMPTY_BODY = YES; 317 | CLANG_WARN_ENUM_CONVERSION = YES; 318 | CLANG_WARN_INT_CONVERSION = YES; 319 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 320 | COPY_PHASE_STRIP = NO; 321 | GCC_C_LANGUAGE_STANDARD = gnu99; 322 | GCC_DYNAMIC_NO_PIC = NO; 323 | GCC_OPTIMIZATION_LEVEL = 0; 324 | GCC_PREPROCESSOR_DEFINITIONS = ( 325 | "DEBUG=1", 326 | "$(inherited)", 327 | ); 328 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 329 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 330 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 331 | GCC_WARN_UNUSED_VARIABLE = YES; 332 | IPHONEOS_DEPLOYMENT_TARGET = 5.1; 333 | ONLY_ACTIVE_ARCH = YES; 334 | SDKROOT = iphoneos; 335 | }; 336 | name = Debug; 337 | }; 338 | 531F2D45172FE64E00C188C4 /* Release */ = { 339 | isa = XCBuildConfiguration; 340 | buildSettings = { 341 | ALWAYS_SEARCH_USER_PATHS = NO; 342 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 343 | CLANG_CXX_LIBRARY = "libc++"; 344 | CLANG_ENABLE_OBJC_ARC = YES; 345 | CLANG_WARN_CONSTANT_CONVERSION = YES; 346 | CLANG_WARN_EMPTY_BODY = YES; 347 | CLANG_WARN_ENUM_CONVERSION = YES; 348 | CLANG_WARN_INT_CONVERSION = YES; 349 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 350 | COPY_PHASE_STRIP = YES; 351 | GCC_C_LANGUAGE_STANDARD = gnu99; 352 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 353 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 354 | GCC_WARN_UNUSED_VARIABLE = YES; 355 | IPHONEOS_DEPLOYMENT_TARGET = 5.1; 356 | SDKROOT = iphoneos; 357 | VALIDATE_PRODUCT = YES; 358 | }; 359 | name = Release; 360 | }; 361 | 531F2D47172FE64E00C188C4 /* Debug */ = { 362 | isa = XCBuildConfiguration; 363 | buildSettings = { 364 | DSTROOT = /tmp/DMRESTRequest.dst; 365 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 366 | GCC_PREFIX_HEADER = "DMRESTRequest/DMRESTRequest-Prefix.pch"; 367 | OTHER_CFLAGS = ( 368 | "-Wextra", 369 | "-Wall", 370 | "-Wno-unused-parameter", 371 | ); 372 | OTHER_LDFLAGS = "-ObjC"; 373 | PRODUCT_NAME = "$(TARGET_NAME)"; 374 | PUBLIC_HEADERS_FOLDER_PATH = include/DMRESTRequest; 375 | SKIP_INSTALL = YES; 376 | WARNING_CFLAGS = ""; 377 | }; 378 | name = Debug; 379 | }; 380 | 531F2D48172FE64E00C188C4 /* Release */ = { 381 | isa = XCBuildConfiguration; 382 | buildSettings = { 383 | DSTROOT = /tmp/DMRESTRequest.dst; 384 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 385 | GCC_PREFIX_HEADER = "DMRESTRequest/DMRESTRequest-Prefix.pch"; 386 | OTHER_CFLAGS = ( 387 | "-Wextra", 388 | "-Wall", 389 | "-Wno-unused-parameter", 390 | ); 391 | OTHER_LDFLAGS = "-ObjC"; 392 | PRODUCT_NAME = "$(TARGET_NAME)"; 393 | PUBLIC_HEADERS_FOLDER_PATH = include/DMRESTRequest; 394 | SKIP_INSTALL = YES; 395 | WARNING_CFLAGS = ""; 396 | }; 397 | name = Release; 398 | }; 399 | 531F2D4A172FE64E00C188C4 /* Debug */ = { 400 | isa = XCBuildConfiguration; 401 | buildSettings = { 402 | FRAMEWORK_SEARCH_PATHS = ( 403 | "\"$(SDKROOT)/Developer/Library/Frameworks\"", 404 | "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", 405 | ); 406 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 407 | GCC_PREFIX_HEADER = "DMRESTRequest/DMRESTRequest-Prefix.pch"; 408 | INFOPLIST_FILE = "DMRESTRequestTests/DMRESTRequestTests-Info.plist"; 409 | PRODUCT_NAME = "$(TARGET_NAME)"; 410 | WRAPPER_EXTENSION = octest; 411 | }; 412 | name = Debug; 413 | }; 414 | 531F2D4B172FE64E00C188C4 /* Release */ = { 415 | isa = XCBuildConfiguration; 416 | buildSettings = { 417 | FRAMEWORK_SEARCH_PATHS = ( 418 | "\"$(SDKROOT)/Developer/Library/Frameworks\"", 419 | "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", 420 | ); 421 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 422 | GCC_PREFIX_HEADER = "DMRESTRequest/DMRESTRequest-Prefix.pch"; 423 | INFOPLIST_FILE = "DMRESTRequestTests/DMRESTRequestTests-Info.plist"; 424 | PRODUCT_NAME = "$(TARGET_NAME)"; 425 | WRAPPER_EXTENSION = octest; 426 | }; 427 | name = Release; 428 | }; 429 | /* End XCBuildConfiguration section */ 430 | 431 | /* Begin XCConfigurationList section */ 432 | 531F2D1C172FE64E00C188C4 /* Build configuration list for PBXProject "DMRESTRequest" */ = { 433 | isa = XCConfigurationList; 434 | buildConfigurations = ( 435 | 531F2D44172FE64E00C188C4 /* Debug */, 436 | 531F2D45172FE64E00C188C4 /* Release */, 437 | ); 438 | defaultConfigurationIsVisible = 0; 439 | defaultConfigurationName = Release; 440 | }; 441 | 531F2D46172FE64E00C188C4 /* Build configuration list for PBXNativeTarget "DMRESTRequest" */ = { 442 | isa = XCConfigurationList; 443 | buildConfigurations = ( 444 | 531F2D47172FE64E00C188C4 /* Debug */, 445 | 531F2D48172FE64E00C188C4 /* Release */, 446 | ); 447 | defaultConfigurationIsVisible = 0; 448 | defaultConfigurationName = Release; 449 | }; 450 | 531F2D49172FE64E00C188C4 /* Build configuration list for PBXNativeTarget "DMRESTRequestTests" */ = { 451 | isa = XCConfigurationList; 452 | buildConfigurations = ( 453 | 531F2D4A172FE64E00C188C4 /* Debug */, 454 | 531F2D4B172FE64E00C188C4 /* Release */, 455 | ); 456 | defaultConfigurationIsVisible = 0; 457 | defaultConfigurationName = Release; 458 | }; 459 | /* End XCConfigurationList section */ 460 | }; 461 | rootObject = 531F2D19172FE64E00C188C4 /* Project object */; 462 | } 463 | -------------------------------------------------------------------------------- /DMRESTRequestExample/DMRESTRequestExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | archiveVersion 6 | 1 7 | classes 8 | 9 | objectVersion 10 | 46 11 | objects 12 | 13 | 041B8CB77FBD47DD82D37D07 14 | 15 | explicitFileType 16 | archive.ar 17 | includeInIndex 18 | 0 19 | isa 20 | PBXFileReference 21 | path 22 | libPods.a 23 | sourceTree 24 | BUILT_PRODUCTS_DIR 25 | 26 | 4F73BD8CA9AD4724A9EC46FE 27 | 28 | includeInIndex 29 | 1 30 | isa 31 | PBXFileReference 32 | lastKnownFileType 33 | text.xcconfig 34 | name 35 | Pods.xcconfig 36 | path 37 | Pods/Pods.xcconfig 38 | sourceTree 39 | <group> 40 | 41 | 531F2D58172FE7BD00C188C4 42 | 43 | children 44 | 45 | 531F2D6A172FE7BD00C188C4 46 | 531F2D63172FE7BD00C188C4 47 | 531F2D62172FE7BD00C188C4 48 | 4F73BD8CA9AD4724A9EC46FE 49 | 50 | isa 51 | PBXGroup 52 | sourceTree 53 | <group> 54 | 55 | 531F2D59172FE7BD00C188C4 56 | 57 | attributes 58 | 59 | LastUpgradeCheck 60 | 0460 61 | ORGANIZATIONNAME 62 | Thomas Ricouard 63 | 64 | buildConfigurationList 65 | 531F2D5C172FE7BD00C188C4 66 | compatibilityVersion 67 | Xcode 3.2 68 | developmentRegion 69 | English 70 | hasScannedForEncodings 71 | 0 72 | isa 73 | PBXProject 74 | knownRegions 75 | 76 | en 77 | 78 | mainGroup 79 | 531F2D58172FE7BD00C188C4 80 | productRefGroup 81 | 531F2D62172FE7BD00C188C4 82 | projectDirPath 83 | 84 | projectReferences 85 | 86 | projectRoot 87 | 88 | targets 89 | 90 | 531F2D60172FE7BD00C188C4 91 | 92 | 93 | 531F2D5C172FE7BD00C188C4 94 | 95 | buildConfigurations 96 | 97 | 531F2D82172FE7BE00C188C4 98 | 531F2D83172FE7BE00C188C4 99 | 100 | defaultConfigurationIsVisible 101 | 0 102 | defaultConfigurationName 103 | Release 104 | isa 105 | XCConfigurationList 106 | 107 | 531F2D5D172FE7BD00C188C4 108 | 109 | buildActionMask 110 | 2147483647 111 | files 112 | 113 | 531F2D71172FE7BD00C188C4 114 | 531F2D75172FE7BD00C188C4 115 | 531F2D7E172FE7BE00C188C4 116 | 117 | isa 118 | PBXSourcesBuildPhase 119 | runOnlyForDeploymentPostprocessing 120 | 0 121 | 122 | 531F2D5E172FE7BD00C188C4 123 | 124 | buildActionMask 125 | 2147483647 126 | files 127 | 128 | 531F2D65172FE7BD00C188C4 129 | 531F2D67172FE7BD00C188C4 130 | 531F2D69172FE7BD00C188C4 131 | B45BE881965442FCB18AEA70 132 | 133 | isa 134 | PBXFrameworksBuildPhase 135 | runOnlyForDeploymentPostprocessing 136 | 0 137 | 138 | 531F2D5F172FE7BD00C188C4 139 | 140 | buildActionMask 141 | 2147483647 142 | files 143 | 144 | 531F2D6F172FE7BD00C188C4 145 | 531F2D77172FE7BD00C188C4 146 | 531F2D79172FE7BD00C188C4 147 | 531F2D7B172FE7BD00C188C4 148 | 531F2D81172FE7BE00C188C4 149 | 150 | isa 151 | PBXResourcesBuildPhase 152 | runOnlyForDeploymentPostprocessing 153 | 0 154 | 155 | 531F2D60172FE7BD00C188C4 156 | 157 | buildConfigurationList 158 | 531F2D84172FE7BE00C188C4 159 | buildPhases 160 | 161 | F352BEB085E649CAB356AEA3 162 | 531F2D5D172FE7BD00C188C4 163 | 531F2D5E172FE7BD00C188C4 164 | 531F2D5F172FE7BD00C188C4 165 | CF2C57A3265045F091B65B17 166 | 167 | buildRules 168 | 169 | dependencies 170 | 171 | isa 172 | PBXNativeTarget 173 | name 174 | DMRESTRequestExample 175 | productName 176 | DMRESTRequestExample 177 | productReference 178 | 531F2D61172FE7BD00C188C4 179 | productType 180 | com.apple.product-type.application 181 | 182 | 531F2D61172FE7BD00C188C4 183 | 184 | explicitFileType 185 | wrapper.application 186 | includeInIndex 187 | 0 188 | isa 189 | PBXFileReference 190 | path 191 | DMRESTRequestExample.app 192 | sourceTree 193 | BUILT_PRODUCTS_DIR 194 | 195 | 531F2D62172FE7BD00C188C4 196 | 197 | children 198 | 199 | 531F2D61172FE7BD00C188C4 200 | 201 | isa 202 | PBXGroup 203 | name 204 | Products 205 | sourceTree 206 | <group> 207 | 208 | 531F2D63172FE7BD00C188C4 209 | 210 | children 211 | 212 | 531F2D64172FE7BD00C188C4 213 | 531F2D66172FE7BD00C188C4 214 | 531F2D68172FE7BD00C188C4 215 | 041B8CB77FBD47DD82D37D07 216 | 217 | isa 218 | PBXGroup 219 | name 220 | Frameworks 221 | sourceTree 222 | <group> 223 | 224 | 531F2D64172FE7BD00C188C4 225 | 226 | isa 227 | PBXFileReference 228 | lastKnownFileType 229 | wrapper.framework 230 | name 231 | UIKit.framework 232 | path 233 | System/Library/Frameworks/UIKit.framework 234 | sourceTree 235 | SDKROOT 236 | 237 | 531F2D65172FE7BD00C188C4 238 | 239 | fileRef 240 | 531F2D64172FE7BD00C188C4 241 | isa 242 | PBXBuildFile 243 | 244 | 531F2D66172FE7BD00C188C4 245 | 246 | isa 247 | PBXFileReference 248 | lastKnownFileType 249 | wrapper.framework 250 | name 251 | Foundation.framework 252 | path 253 | System/Library/Frameworks/Foundation.framework 254 | sourceTree 255 | SDKROOT 256 | 257 | 531F2D67172FE7BD00C188C4 258 | 259 | fileRef 260 | 531F2D66172FE7BD00C188C4 261 | isa 262 | PBXBuildFile 263 | 264 | 531F2D68172FE7BD00C188C4 265 | 266 | isa 267 | PBXFileReference 268 | lastKnownFileType 269 | wrapper.framework 270 | name 271 | CoreGraphics.framework 272 | path 273 | System/Library/Frameworks/CoreGraphics.framework 274 | sourceTree 275 | SDKROOT 276 | 277 | 531F2D69172FE7BD00C188C4 278 | 279 | fileRef 280 | 531F2D68172FE7BD00C188C4 281 | isa 282 | PBXBuildFile 283 | 284 | 531F2D6A172FE7BD00C188C4 285 | 286 | children 287 | 288 | 531F2D73172FE7BD00C188C4 289 | 531F2D74172FE7BD00C188C4 290 | 531F2D7C172FE7BD00C188C4 291 | 531F2D7D172FE7BE00C188C4 292 | 531F2D7F172FE7BE00C188C4 293 | 531F2D6B172FE7BD00C188C4 294 | 295 | isa 296 | PBXGroup 297 | path 298 | DMRESTRequestExample 299 | sourceTree 300 | <group> 301 | 302 | 531F2D6B172FE7BD00C188C4 303 | 304 | children 305 | 306 | 531F2D6C172FE7BD00C188C4 307 | 531F2D6D172FE7BD00C188C4 308 | 531F2D70172FE7BD00C188C4 309 | 531F2D72172FE7BD00C188C4 310 | 531F2D76172FE7BD00C188C4 311 | 531F2D78172FE7BD00C188C4 312 | 531F2D7A172FE7BD00C188C4 313 | 314 | isa 315 | PBXGroup 316 | name 317 | Supporting Files 318 | sourceTree 319 | <group> 320 | 321 | 531F2D6C172FE7BD00C188C4 322 | 323 | isa 324 | PBXFileReference 325 | lastKnownFileType 326 | text.plist.xml 327 | path 328 | DMRESTRequestExample-Info.plist 329 | sourceTree 330 | <group> 331 | 332 | 531F2D6D172FE7BD00C188C4 333 | 334 | children 335 | 336 | 531F2D6E172FE7BD00C188C4 337 | 338 | isa 339 | PBXVariantGroup 340 | name 341 | InfoPlist.strings 342 | sourceTree 343 | <group> 344 | 345 | 531F2D6E172FE7BD00C188C4 346 | 347 | isa 348 | PBXFileReference 349 | lastKnownFileType 350 | text.plist.strings 351 | name 352 | en 353 | path 354 | en.lproj/InfoPlist.strings 355 | sourceTree 356 | <group> 357 | 358 | 531F2D6F172FE7BD00C188C4 359 | 360 | fileRef 361 | 531F2D6D172FE7BD00C188C4 362 | isa 363 | PBXBuildFile 364 | 365 | 531F2D70172FE7BD00C188C4 366 | 367 | isa 368 | PBXFileReference 369 | lastKnownFileType 370 | sourcecode.c.objc 371 | path 372 | main.m 373 | sourceTree 374 | <group> 375 | 376 | 531F2D71172FE7BD00C188C4 377 | 378 | fileRef 379 | 531F2D70172FE7BD00C188C4 380 | isa 381 | PBXBuildFile 382 | 383 | 531F2D72172FE7BD00C188C4 384 | 385 | isa 386 | PBXFileReference 387 | lastKnownFileType 388 | sourcecode.c.h 389 | path 390 | DMRESTRequestExample-Prefix.pch 391 | sourceTree 392 | <group> 393 | 394 | 531F2D73172FE7BD00C188C4 395 | 396 | isa 397 | PBXFileReference 398 | lastKnownFileType 399 | sourcecode.c.h 400 | path 401 | AppDelegate.h 402 | sourceTree 403 | <group> 404 | 405 | 531F2D74172FE7BD00C188C4 406 | 407 | isa 408 | PBXFileReference 409 | lastKnownFileType 410 | sourcecode.c.objc 411 | path 412 | AppDelegate.m 413 | sourceTree 414 | <group> 415 | 416 | 531F2D75172FE7BD00C188C4 417 | 418 | fileRef 419 | 531F2D74172FE7BD00C188C4 420 | isa 421 | PBXBuildFile 422 | 423 | 531F2D76172FE7BD00C188C4 424 | 425 | isa 426 | PBXFileReference 427 | lastKnownFileType 428 | image.png 429 | path 430 | Default.png 431 | sourceTree 432 | <group> 433 | 434 | 531F2D77172FE7BD00C188C4 435 | 436 | fileRef 437 | 531F2D76172FE7BD00C188C4 438 | isa 439 | PBXBuildFile 440 | 441 | 531F2D78172FE7BD00C188C4 442 | 443 | isa 444 | PBXFileReference 445 | lastKnownFileType 446 | image.png 447 | path 448 | Default@2x.png 449 | sourceTree 450 | <group> 451 | 452 | 531F2D79172FE7BD00C188C4 453 | 454 | fileRef 455 | 531F2D78172FE7BD00C188C4 456 | isa 457 | PBXBuildFile 458 | 459 | 531F2D7A172FE7BD00C188C4 460 | 461 | isa 462 | PBXFileReference 463 | lastKnownFileType 464 | image.png 465 | path 466 | Default-568h@2x.png 467 | sourceTree 468 | <group> 469 | 470 | 531F2D7B172FE7BD00C188C4 471 | 472 | fileRef 473 | 531F2D7A172FE7BD00C188C4 474 | isa 475 | PBXBuildFile 476 | 477 | 531F2D7C172FE7BD00C188C4 478 | 479 | isa 480 | PBXFileReference 481 | lastKnownFileType 482 | sourcecode.c.h 483 | path 484 | ViewController.h 485 | sourceTree 486 | <group> 487 | 488 | 531F2D7D172FE7BE00C188C4 489 | 490 | isa 491 | PBXFileReference 492 | lastKnownFileType 493 | sourcecode.c.objc 494 | path 495 | ViewController.m 496 | sourceTree 497 | <group> 498 | 499 | 531F2D7E172FE7BE00C188C4 500 | 501 | fileRef 502 | 531F2D7D172FE7BE00C188C4 503 | isa 504 | PBXBuildFile 505 | 506 | 531F2D7F172FE7BE00C188C4 507 | 508 | children 509 | 510 | 531F2D80172FE7BE00C188C4 511 | 512 | isa 513 | PBXVariantGroup 514 | name 515 | ViewController.xib 516 | sourceTree 517 | <group> 518 | 519 | 531F2D80172FE7BE00C188C4 520 | 521 | isa 522 | PBXFileReference 523 | lastKnownFileType 524 | file.xib 525 | name 526 | en 527 | path 528 | en.lproj/ViewController.xib 529 | sourceTree 530 | <group> 531 | 532 | 531F2D81172FE7BE00C188C4 533 | 534 | fileRef 535 | 531F2D7F172FE7BE00C188C4 536 | isa 537 | PBXBuildFile 538 | 539 | 531F2D82172FE7BE00C188C4 540 | 541 | buildSettings 542 | 543 | ALWAYS_SEARCH_USER_PATHS 544 | NO 545 | CLANG_CXX_LANGUAGE_STANDARD 546 | gnu++0x 547 | CLANG_CXX_LIBRARY 548 | libc++ 549 | CLANG_ENABLE_OBJC_ARC 550 | YES 551 | CLANG_WARN_CONSTANT_CONVERSION 552 | YES 553 | CLANG_WARN_EMPTY_BODY 554 | YES 555 | CLANG_WARN_ENUM_CONVERSION 556 | YES 557 | CLANG_WARN_INT_CONVERSION 558 | YES 559 | CLANG_WARN__DUPLICATE_METHOD_MATCH 560 | YES 561 | CODE_SIGN_IDENTITY[sdk=iphoneos*] 562 | iPhone Developer 563 | COPY_PHASE_STRIP 564 | NO 565 | GCC_C_LANGUAGE_STANDARD 566 | gnu99 567 | GCC_DYNAMIC_NO_PIC 568 | NO 569 | GCC_OPTIMIZATION_LEVEL 570 | 0 571 | GCC_PREPROCESSOR_DEFINITIONS 572 | 573 | DEBUG=1 574 | $(inherited) 575 | 576 | GCC_SYMBOLS_PRIVATE_EXTERN 577 | NO 578 | GCC_WARN_ABOUT_RETURN_TYPE 579 | YES 580 | GCC_WARN_UNINITIALIZED_AUTOS 581 | YES 582 | GCC_WARN_UNUSED_VARIABLE 583 | YES 584 | IPHONEOS_DEPLOYMENT_TARGET 585 | 6.1 586 | ONLY_ACTIVE_ARCH 587 | YES 588 | SDKROOT 589 | iphoneos 590 | 591 | isa 592 | XCBuildConfiguration 593 | name 594 | Debug 595 | 596 | 531F2D83172FE7BE00C188C4 597 | 598 | buildSettings 599 | 600 | ALWAYS_SEARCH_USER_PATHS 601 | NO 602 | CLANG_CXX_LANGUAGE_STANDARD 603 | gnu++0x 604 | CLANG_CXX_LIBRARY 605 | libc++ 606 | CLANG_ENABLE_OBJC_ARC 607 | YES 608 | CLANG_WARN_CONSTANT_CONVERSION 609 | YES 610 | CLANG_WARN_EMPTY_BODY 611 | YES 612 | CLANG_WARN_ENUM_CONVERSION 613 | YES 614 | CLANG_WARN_INT_CONVERSION 615 | YES 616 | CLANG_WARN__DUPLICATE_METHOD_MATCH 617 | YES 618 | CODE_SIGN_IDENTITY[sdk=iphoneos*] 619 | iPhone Developer 620 | COPY_PHASE_STRIP 621 | YES 622 | GCC_C_LANGUAGE_STANDARD 623 | gnu99 624 | GCC_WARN_ABOUT_RETURN_TYPE 625 | YES 626 | GCC_WARN_UNINITIALIZED_AUTOS 627 | YES 628 | GCC_WARN_UNUSED_VARIABLE 629 | YES 630 | IPHONEOS_DEPLOYMENT_TARGET 631 | 6.1 632 | OTHER_CFLAGS 633 | -DNS_BLOCK_ASSERTIONS=1 634 | SDKROOT 635 | iphoneos 636 | VALIDATE_PRODUCT 637 | YES 638 | 639 | isa 640 | XCBuildConfiguration 641 | name 642 | Release 643 | 644 | 531F2D84172FE7BE00C188C4 645 | 646 | buildConfigurations 647 | 648 | 531F2D85172FE7BE00C188C4 649 | 531F2D86172FE7BE00C188C4 650 | 651 | defaultConfigurationIsVisible 652 | 0 653 | defaultConfigurationName 654 | Release 655 | isa 656 | XCConfigurationList 657 | 658 | 531F2D85172FE7BE00C188C4 659 | 660 | baseConfigurationReference 661 | 4F73BD8CA9AD4724A9EC46FE 662 | buildSettings 663 | 664 | ALWAYS_SEARCH_USER_PATHS 665 | YES 666 | GCC_PRECOMPILE_PREFIX_HEADER 667 | YES 668 | GCC_PREFIX_HEADER 669 | DMRESTRequestExample/DMRESTRequestExample-Prefix.pch 670 | INFOPLIST_FILE 671 | DMRESTRequestExample/DMRESTRequestExample-Info.plist 672 | PRODUCT_NAME 673 | $(TARGET_NAME) 674 | USER_HEADER_SEARCH_PATHS 675 | $(PROJECT_TEMP_DIR)/../UninstalledProducts/include 676 | WRAPPER_EXTENSION 677 | app 678 | 679 | isa 680 | XCBuildConfiguration 681 | name 682 | Debug 683 | 684 | 531F2D86172FE7BE00C188C4 685 | 686 | baseConfigurationReference 687 | 4F73BD8CA9AD4724A9EC46FE 688 | buildSettings 689 | 690 | ALWAYS_SEARCH_USER_PATHS 691 | YES 692 | GCC_PRECOMPILE_PREFIX_HEADER 693 | YES 694 | GCC_PREFIX_HEADER 695 | DMRESTRequestExample/DMRESTRequestExample-Prefix.pch 696 | INFOPLIST_FILE 697 | DMRESTRequestExample/DMRESTRequestExample-Info.plist 698 | PRODUCT_NAME 699 | $(TARGET_NAME) 700 | USER_HEADER_SEARCH_PATHS 701 | $(PROJECT_TEMP_DIR)/../UninstalledProducts/include 702 | WRAPPER_EXTENSION 703 | app 704 | 705 | isa 706 | XCBuildConfiguration 707 | name 708 | Release 709 | 710 | B45BE881965442FCB18AEA70 711 | 712 | fileRef 713 | 041B8CB77FBD47DD82D37D07 714 | isa 715 | PBXBuildFile 716 | 717 | CF2C57A3265045F091B65B17 718 | 719 | buildActionMask 720 | 2147483647 721 | files 722 | 723 | inputPaths 724 | 725 | isa 726 | PBXShellScriptBuildPhase 727 | name 728 | Copy Pods Resources 729 | outputPaths 730 | 731 | runOnlyForDeploymentPostprocessing 732 | 0 733 | shellPath 734 | /bin/sh 735 | shellScript 736 | "${SRCROOT}/Pods/Pods-resources.sh" 737 | 738 | showEnvVarsInLog 739 | 0 740 | 741 | F352BEB085E649CAB356AEA3 742 | 743 | buildActionMask 744 | 2147483647 745 | files 746 | 747 | inputPaths 748 | 749 | isa 750 | PBXShellScriptBuildPhase 751 | name 752 | Check Pods Manifest.lock 753 | outputPaths 754 | 755 | runOnlyForDeploymentPostprocessing 756 | 0 757 | shellPath 758 | /bin/sh 759 | shellScript 760 | diff "${PODS_ROOT}/../Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null 761 | if [[ $? != 0 ]] ; then 762 | cat << EOM 763 | error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation. 764 | EOM 765 | exit 1 766 | fi 767 | 768 | showEnvVarsInLog 769 | 0 770 | 771 | 772 | rootObject 773 | 531F2D59172FE7BD00C188C4 774 | 775 | 776 | --------------------------------------------------------------------------------