├── .gitignore ├── .swift-version ├── .travis.yml ├── LICENSE ├── Podfile ├── Podfile.lock ├── R9HTTPRequest.podspec ├── R9HTTPRequest.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── R9HTTPRequest.xcworkspace ├── contents.xcworkspacedata └── xcuserdata │ ├── taisuke.xcuserdatad │ └── UserInterfaceState.xcuserstate │ └── taisukefujita.xcuserdatad │ ├── UserInterfaceState.xcuserstate │ └── xcdebugger │ └── Breakpoints_v2.xcbkptlist ├── R9HTTPRequest ├── HTTPClient.swift ├── HttpDataClient.swift ├── HttpJsonClient.swift ├── Info.plist └── R9HTTPRequest.h ├── R9HTTPRequestTests ├── HttpbinResponse.swift ├── Info.plist └── R9HTTPRequestTests.swift └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.swp 3 | *~.nib 4 | build/* 5 | *.xcodeproj/project.xcworkspace/xcuserdata/* 6 | *.pbxuser 7 | *.perspective 8 | *.perspectivev3 9 | *.mode1v3 10 | *.mode2v3 11 | *.xcodeproj/xcuserdata/* 12 | 13 | Pods -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | 4.0 -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | osx_image: xcode9 3 | 4 | before_install: 5 | - gem install xcpretty 6 | - pod repo update 7 | 8 | script: 9 | - xcodebuild clean build -sdk iphonesimulator -workspace R9HTTPRequest.xcworkspace -scheme R9HTTPRequest CODE_SIGNING_REQUIRED=NO | xcpretty -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Taisuke Fujita 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | # Uncomment the next line to define a global platform for your project 3 | # platform :ios, '9.0' 4 | 5 | target 'R9HTTPRequest' do 6 | # Comment the next line if you're not using Swift and don't want to use dynamic frameworks 7 | use_frameworks! 8 | 9 | # Pods for ImprovisationPiano 10 | source 'https://github.com/CocoaPods/Specs.git' 11 | platform :ios, '10.0' 12 | 13 | pod 'RxSwift' 14 | pod 'RxCocoa' 15 | target 'R9HTTPRequestTests' do 16 | inherit! :search_paths 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - RxCocoa (4.0.0): 3 | - RxSwift (~> 4.0) 4 | - RxSwift (4.0.0) 5 | 6 | DEPENDENCIES: 7 | - RxCocoa 8 | - RxSwift 9 | 10 | SPEC CHECKSUMS: 11 | RxCocoa: d62846ca96495d862fa4c59ea7d87e5031d7340e 12 | RxSwift: fd680d75283beb5e2559486f3c0ff852f0d35334 13 | 14 | PODFILE CHECKSUM: b0fd97ec1c1eb81f3851d95f86f3916197eb0548 15 | 16 | COCOAPODS: 1.3.1 17 | -------------------------------------------------------------------------------- /R9HTTPRequest.podspec: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | # 3 | # Be sure to run `pod spec lint R9MIDISequencer.podspec' to ensure this is a 4 | # valid spec and to remove all comments including this before submitting the spec. 5 | # 6 | # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html 7 | # To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/ 8 | # 9 | 10 | Pod::Spec.new do |s| 11 | 12 | # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 13 | # 14 | # These will help people to find your library, and whilst it 15 | # can feel like a chore to fill in it's definitely to your advantage. The 16 | # summary should be tweet-length, and the description more in depth. 17 | # 18 | 19 | s.name = "R9HTTPRequest" 20 | s.version = "2.0.1" 21 | s.summary = "HTTP client" 22 | 23 | # This description is used to generate tags and improve search results. 24 | # * Think: What does it do? Why did you write it? What is the focus? 25 | # * Try to keep it short, snappy and to the point. 26 | # * Write the description between the DESC delimiters below. 27 | # * Finally, don't worry about the indent, CocoaPods strips it! 28 | s.description = "HTTP client" 29 | 30 | s.homepage = "https://github.com/glassonion1/R9HTTPRequest" 31 | # s.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif" 32 | 33 | 34 | # ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 35 | # 36 | # Licensing your code is important. See http://choosealicense.com for more info. 37 | # CocoaPods will detect a license file if there is a named LICENSE* 38 | # Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'. 39 | # 40 | 41 | s.license = "MIT" 42 | # s.license = { :type => "MIT", :file => "FILE_LICENSE" } 43 | 44 | 45 | # ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 46 | # 47 | # Specify the authors of the library, with email addresses. Email addresses 48 | # of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also 49 | # accepts just a name if you'd rather not provide an email address. 50 | # 51 | # Specify a social_media_url where others can refer to, for example a twitter 52 | # profile URL. 53 | # 54 | 55 | s.author = { "Taisuke Fujita" => "glassonion999@gmail.com" } 56 | # Or just: s.author = "Taisuke Fujita" 57 | # s.authors = { "Taisuke Fujita" => "glassonion999@gmail.com" } 58 | # s.social_media_url = "http://twitter.com/Taisuke Fujita" 59 | 60 | # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 61 | # 62 | # If this Pod runs only on iOS or OS X, then specify the platform and 63 | # the deployment target. You can optionally include the target after the platform. 64 | # 65 | 66 | s.platform = :ios, "11.0" 67 | s.requires_arc = true 68 | 69 | # s.platform = :ios 70 | # s.platform = :ios, "5.0" 71 | 72 | # When using multiple platforms 73 | # s.ios.deployment_target = "5.0" 74 | # s.osx.deployment_target = "10.7" 75 | # s.watchos.deployment_target = "2.0" 76 | # s.tvos.deployment_target = "9.0" 77 | 78 | 79 | # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 80 | # 81 | # Specify the location from where the source should be retrieved. 82 | # Supports git, hg, bzr, svn and HTTP. 83 | # 84 | 85 | s.source = { :git => "https://github.com/glassonion1/R9HTTPRequest.git", :tag => "#{s.version}" } 86 | 87 | 88 | # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 89 | # 90 | # CocoaPods is smart about how it includes source code. For source files 91 | # giving a folder will include any swift, h, m, mm, c & cpp files. 92 | # For header files it will include any header in the folder. 93 | # Not including the public_header_files will make all headers public. 94 | # 95 | 96 | s.source_files = "R9HTTPRequest/**/*.{h,m,swift}" 97 | #s.exclude_files = "Classes/Exclude" 98 | 99 | # s.public_header_files = "Classes/**/*.h" 100 | 101 | 102 | # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 103 | # 104 | # A list of resources included with the Pod. These are copied into the 105 | # target bundle with a build phase script. Anything else will be cleaned. 106 | # You can preserve files from being cleaned, please don't preserve 107 | # non-essential files like tests, examples and documentation. 108 | # 109 | 110 | # s.resource = "icon.png" 111 | # s.resources = "Resources/*.png" 112 | 113 | # s.preserve_paths = "FilesToSave", "MoreFilesToSave" 114 | 115 | 116 | # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 117 | # 118 | # Link your library with frameworks, or libraries. Libraries do not include 119 | # the lib prefix of their name. 120 | # 121 | 122 | # s.framework = "SomeFramework" 123 | # s.frameworks = "SomeFramework", "AnotherFramework" 124 | 125 | # s.library = "iconv" 126 | # s.libraries = "iconv", "xml2" 127 | 128 | 129 | # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 130 | # 131 | # If your library depends on compiler flags you can set them in the xcconfig hash 132 | # where they will only apply to your library. If you depend on other Podspecs 133 | # you can include multiple dependencies to ensure it works. 134 | 135 | # s.requires_arc = true 136 | 137 | # s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" } 138 | # s.dependency "JSONKit", "~> 1.4" 139 | s.dependency 'RxSwift', '~> 4.0.0' 140 | s.dependency 'RxCocoa', '~> 4.0.0' 141 | end 142 | -------------------------------------------------------------------------------- /R9HTTPRequest.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 48; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 4716088CF92A2E46FA58C577 /* Pods_R9HTTPRequest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 508B69A27FB86AC8004572F4 /* Pods_R9HTTPRequest.framework */; }; 11 | DAACBFD11F832F1B00B4F275 /* R9HTTPRequest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DAACBFC71F832F1B00B4F275 /* R9HTTPRequest.framework */; }; 12 | DAACBFD61F832F1B00B4F275 /* R9HTTPRequestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAACBFD51F832F1B00B4F275 /* R9HTTPRequestTests.swift */; }; 13 | DAACBFD81F832F1B00B4F275 /* R9HTTPRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = DAACBFCA1F832F1B00B4F275 /* R9HTTPRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; 14 | DAACBFE41F83312100B4F275 /* HTTPClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAACBFE31F83312100B4F275 /* HTTPClient.swift */; }; 15 | DAACBFE61F83631C00B4F275 /* HttpJsonClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAACBFE51F83631C00B4F275 /* HttpJsonClient.swift */; }; 16 | DAACBFE81F8364D800B4F275 /* HttpDataClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAACBFE71F8364D800B4F275 /* HttpDataClient.swift */; }; 17 | DAACBFEA1F8369DF00B4F275 /* HttpbinResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAACBFE91F8369DF00B4F275 /* HttpbinResponse.swift */; }; 18 | E1A3B3EF0B4639AEE7086636 /* Pods_R9HTTPRequestTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1F921C6F259C8F9AC3F8ACC9 /* Pods_R9HTTPRequestTests.framework */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXContainerItemProxy section */ 22 | DAACBFD21F832F1B00B4F275 /* PBXContainerItemProxy */ = { 23 | isa = PBXContainerItemProxy; 24 | containerPortal = DAACBFBE1F832F1B00B4F275 /* Project object */; 25 | proxyType = 1; 26 | remoteGlobalIDString = DAACBFC61F832F1B00B4F275; 27 | remoteInfo = R9HTTPRequest; 28 | }; 29 | /* End PBXContainerItemProxy section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | 1F921C6F259C8F9AC3F8ACC9 /* Pods_R9HTTPRequestTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_R9HTTPRequestTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 33 | 4262D436890A3823A01B4D0E /* Pods-R9HTTPRequestTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-R9HTTPRequestTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-R9HTTPRequestTests/Pods-R9HTTPRequestTests.debug.xcconfig"; sourceTree = ""; }; 34 | 508B69A27FB86AC8004572F4 /* Pods_R9HTTPRequest.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_R9HTTPRequest.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 35 | 77F0207A298B2127E9281D5F /* Pods-R9HTTPRequest.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-R9HTTPRequest.debug.xcconfig"; path = "Pods/Target Support Files/Pods-R9HTTPRequest/Pods-R9HTTPRequest.debug.xcconfig"; sourceTree = ""; }; 36 | 7F8E6B3192C5CC820D3319D4 /* Pods-R9HTTPRequestTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-R9HTTPRequestTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-R9HTTPRequestTests/Pods-R9HTTPRequestTests.release.xcconfig"; sourceTree = ""; }; 37 | D670887EA37A2A7FC63992AD /* Pods-R9HTTPRequest.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-R9HTTPRequest.release.xcconfig"; path = "Pods/Target Support Files/Pods-R9HTTPRequest/Pods-R9HTTPRequest.release.xcconfig"; sourceTree = ""; }; 38 | DAACBFC71F832F1B00B4F275 /* R9HTTPRequest.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = R9HTTPRequest.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | DAACBFCA1F832F1B00B4F275 /* R9HTTPRequest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = R9HTTPRequest.h; sourceTree = ""; }; 40 | DAACBFCB1F832F1B00B4F275 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 41 | DAACBFD01F832F1B00B4F275 /* R9HTTPRequestTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = R9HTTPRequestTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 42 | DAACBFD51F832F1B00B4F275 /* R9HTTPRequestTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = R9HTTPRequestTests.swift; sourceTree = ""; }; 43 | DAACBFD71F832F1B00B4F275 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 44 | DAACBFE31F83312100B4F275 /* HTTPClient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTTPClient.swift; sourceTree = ""; }; 45 | DAACBFE51F83631C00B4F275 /* HttpJsonClient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HttpJsonClient.swift; sourceTree = ""; }; 46 | DAACBFE71F8364D800B4F275 /* HttpDataClient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HttpDataClient.swift; sourceTree = ""; }; 47 | DAACBFE91F8369DF00B4F275 /* HttpbinResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HttpbinResponse.swift; sourceTree = ""; }; 48 | /* End PBXFileReference section */ 49 | 50 | /* Begin PBXFrameworksBuildPhase section */ 51 | DAACBFC31F832F1B00B4F275 /* Frameworks */ = { 52 | isa = PBXFrameworksBuildPhase; 53 | buildActionMask = 2147483647; 54 | files = ( 55 | 4716088CF92A2E46FA58C577 /* Pods_R9HTTPRequest.framework in Frameworks */, 56 | ); 57 | runOnlyForDeploymentPostprocessing = 0; 58 | }; 59 | DAACBFCD1F832F1B00B4F275 /* Frameworks */ = { 60 | isa = PBXFrameworksBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | DAACBFD11F832F1B00B4F275 /* R9HTTPRequest.framework in Frameworks */, 64 | E1A3B3EF0B4639AEE7086636 /* Pods_R9HTTPRequestTests.framework in Frameworks */, 65 | ); 66 | runOnlyForDeploymentPostprocessing = 0; 67 | }; 68 | /* End PBXFrameworksBuildPhase section */ 69 | 70 | /* Begin PBXGroup section */ 71 | 54CF11BD490ECCD57B3B6532 /* Frameworks */ = { 72 | isa = PBXGroup; 73 | children = ( 74 | 508B69A27FB86AC8004572F4 /* Pods_R9HTTPRequest.framework */, 75 | 1F921C6F259C8F9AC3F8ACC9 /* Pods_R9HTTPRequestTests.framework */, 76 | ); 77 | name = Frameworks; 78 | sourceTree = ""; 79 | }; 80 | DAACBFBD1F832F1B00B4F275 = { 81 | isa = PBXGroup; 82 | children = ( 83 | DAACBFC91F832F1B00B4F275 /* R9HTTPRequest */, 84 | DAACBFD41F832F1B00B4F275 /* R9HTTPRequestTests */, 85 | DAACBFC81F832F1B00B4F275 /* Products */, 86 | E25B99DC596417A384BF41C1 /* Pods */, 87 | 54CF11BD490ECCD57B3B6532 /* Frameworks */, 88 | ); 89 | sourceTree = ""; 90 | }; 91 | DAACBFC81F832F1B00B4F275 /* Products */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | DAACBFC71F832F1B00B4F275 /* R9HTTPRequest.framework */, 95 | DAACBFD01F832F1B00B4F275 /* R9HTTPRequestTests.xctest */, 96 | ); 97 | name = Products; 98 | sourceTree = ""; 99 | }; 100 | DAACBFC91F832F1B00B4F275 /* R9HTTPRequest */ = { 101 | isa = PBXGroup; 102 | children = ( 103 | DAACBFCA1F832F1B00B4F275 /* R9HTTPRequest.h */, 104 | DAACBFCB1F832F1B00B4F275 /* Info.plist */, 105 | DAACBFE31F83312100B4F275 /* HTTPClient.swift */, 106 | DAACBFE51F83631C00B4F275 /* HttpJsonClient.swift */, 107 | DAACBFE71F8364D800B4F275 /* HttpDataClient.swift */, 108 | ); 109 | path = R9HTTPRequest; 110 | sourceTree = ""; 111 | }; 112 | DAACBFD41F832F1B00B4F275 /* R9HTTPRequestTests */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | DAACBFD51F832F1B00B4F275 /* R9HTTPRequestTests.swift */, 116 | DAACBFD71F832F1B00B4F275 /* Info.plist */, 117 | DAACBFE91F8369DF00B4F275 /* HttpbinResponse.swift */, 118 | ); 119 | path = R9HTTPRequestTests; 120 | sourceTree = ""; 121 | }; 122 | E25B99DC596417A384BF41C1 /* Pods */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | 77F0207A298B2127E9281D5F /* Pods-R9HTTPRequest.debug.xcconfig */, 126 | D670887EA37A2A7FC63992AD /* Pods-R9HTTPRequest.release.xcconfig */, 127 | 4262D436890A3823A01B4D0E /* Pods-R9HTTPRequestTests.debug.xcconfig */, 128 | 7F8E6B3192C5CC820D3319D4 /* Pods-R9HTTPRequestTests.release.xcconfig */, 129 | ); 130 | name = Pods; 131 | sourceTree = ""; 132 | }; 133 | /* End PBXGroup section */ 134 | 135 | /* Begin PBXHeadersBuildPhase section */ 136 | DAACBFC41F832F1B00B4F275 /* Headers */ = { 137 | isa = PBXHeadersBuildPhase; 138 | buildActionMask = 2147483647; 139 | files = ( 140 | DAACBFD81F832F1B00B4F275 /* R9HTTPRequest.h in Headers */, 141 | ); 142 | runOnlyForDeploymentPostprocessing = 0; 143 | }; 144 | /* End PBXHeadersBuildPhase section */ 145 | 146 | /* Begin PBXNativeTarget section */ 147 | DAACBFC61F832F1B00B4F275 /* R9HTTPRequest */ = { 148 | isa = PBXNativeTarget; 149 | buildConfigurationList = DAACBFDB1F832F1B00B4F275 /* Build configuration list for PBXNativeTarget "R9HTTPRequest" */; 150 | buildPhases = ( 151 | 3CBEB8D44FCA27148E4ED583 /* [CP] Check Pods Manifest.lock */, 152 | DAACBFC21F832F1B00B4F275 /* Sources */, 153 | DAACBFC31F832F1B00B4F275 /* Frameworks */, 154 | DAACBFC41F832F1B00B4F275 /* Headers */, 155 | DAACBFC51F832F1B00B4F275 /* Resources */, 156 | 52E1C37A62C8EE153FD1EDC0 /* [CP] Copy Pods Resources */, 157 | ); 158 | buildRules = ( 159 | ); 160 | dependencies = ( 161 | ); 162 | name = R9HTTPRequest; 163 | productName = R9HTTPRequest; 164 | productReference = DAACBFC71F832F1B00B4F275 /* R9HTTPRequest.framework */; 165 | productType = "com.apple.product-type.framework"; 166 | }; 167 | DAACBFCF1F832F1B00B4F275 /* R9HTTPRequestTests */ = { 168 | isa = PBXNativeTarget; 169 | buildConfigurationList = DAACBFDE1F832F1B00B4F275 /* Build configuration list for PBXNativeTarget "R9HTTPRequestTests" */; 170 | buildPhases = ( 171 | A21F871CFB97D53B2614A437 /* [CP] Check Pods Manifest.lock */, 172 | DAACBFCC1F832F1B00B4F275 /* Sources */, 173 | DAACBFCD1F832F1B00B4F275 /* Frameworks */, 174 | DAACBFCE1F832F1B00B4F275 /* Resources */, 175 | 15F3054CEB79E4C8E64B263F /* [CP] Embed Pods Frameworks */, 176 | 36884FAD9496C878BF4C18C3 /* [CP] Copy Pods Resources */, 177 | ); 178 | buildRules = ( 179 | ); 180 | dependencies = ( 181 | DAACBFD31F832F1B00B4F275 /* PBXTargetDependency */, 182 | ); 183 | name = R9HTTPRequestTests; 184 | productName = R9HTTPRequestTests; 185 | productReference = DAACBFD01F832F1B00B4F275 /* R9HTTPRequestTests.xctest */; 186 | productType = "com.apple.product-type.bundle.unit-test"; 187 | }; 188 | /* End PBXNativeTarget section */ 189 | 190 | /* Begin PBXProject section */ 191 | DAACBFBE1F832F1B00B4F275 /* Project object */ = { 192 | isa = PBXProject; 193 | attributes = { 194 | LastSwiftUpdateCheck = 0900; 195 | LastUpgradeCheck = 0900; 196 | ORGANIZATIONNAME = Revolution9; 197 | TargetAttributes = { 198 | DAACBFC61F832F1B00B4F275 = { 199 | CreatedOnToolsVersion = 9.0; 200 | LastSwiftMigration = 0900; 201 | ProvisioningStyle = Automatic; 202 | }; 203 | DAACBFCF1F832F1B00B4F275 = { 204 | CreatedOnToolsVersion = 9.0; 205 | ProvisioningStyle = Manual; 206 | }; 207 | }; 208 | }; 209 | buildConfigurationList = DAACBFC11F832F1B00B4F275 /* Build configuration list for PBXProject "R9HTTPRequest" */; 210 | compatibilityVersion = "Xcode 8.0"; 211 | developmentRegion = en; 212 | hasScannedForEncodings = 0; 213 | knownRegions = ( 214 | en, 215 | ); 216 | mainGroup = DAACBFBD1F832F1B00B4F275; 217 | productRefGroup = DAACBFC81F832F1B00B4F275 /* Products */; 218 | projectDirPath = ""; 219 | projectRoot = ""; 220 | targets = ( 221 | DAACBFC61F832F1B00B4F275 /* R9HTTPRequest */, 222 | DAACBFCF1F832F1B00B4F275 /* R9HTTPRequestTests */, 223 | ); 224 | }; 225 | /* End PBXProject section */ 226 | 227 | /* Begin PBXResourcesBuildPhase section */ 228 | DAACBFC51F832F1B00B4F275 /* Resources */ = { 229 | isa = PBXResourcesBuildPhase; 230 | buildActionMask = 2147483647; 231 | files = ( 232 | ); 233 | runOnlyForDeploymentPostprocessing = 0; 234 | }; 235 | DAACBFCE1F832F1B00B4F275 /* Resources */ = { 236 | isa = PBXResourcesBuildPhase; 237 | buildActionMask = 2147483647; 238 | files = ( 239 | ); 240 | runOnlyForDeploymentPostprocessing = 0; 241 | }; 242 | /* End PBXResourcesBuildPhase section */ 243 | 244 | /* Begin PBXShellScriptBuildPhase section */ 245 | 15F3054CEB79E4C8E64B263F /* [CP] Embed Pods Frameworks */ = { 246 | isa = PBXShellScriptBuildPhase; 247 | buildActionMask = 2147483647; 248 | files = ( 249 | ); 250 | inputPaths = ( 251 | "${SRCROOT}/Pods/Target Support Files/Pods-R9HTTPRequestTests/Pods-R9HTTPRequestTests-frameworks.sh", 252 | "${BUILT_PRODUCTS_DIR}/RxCocoa/RxCocoa.framework", 253 | "${BUILT_PRODUCTS_DIR}/RxSwift/RxSwift.framework", 254 | ); 255 | name = "[CP] Embed Pods Frameworks"; 256 | outputPaths = ( 257 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxCocoa.framework", 258 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxSwift.framework", 259 | ); 260 | runOnlyForDeploymentPostprocessing = 0; 261 | shellPath = /bin/sh; 262 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-R9HTTPRequestTests/Pods-R9HTTPRequestTests-frameworks.sh\"\n"; 263 | showEnvVarsInLog = 0; 264 | }; 265 | 36884FAD9496C878BF4C18C3 /* [CP] Copy Pods Resources */ = { 266 | isa = PBXShellScriptBuildPhase; 267 | buildActionMask = 2147483647; 268 | files = ( 269 | ); 270 | inputPaths = ( 271 | ); 272 | name = "[CP] Copy Pods Resources"; 273 | outputPaths = ( 274 | ); 275 | runOnlyForDeploymentPostprocessing = 0; 276 | shellPath = /bin/sh; 277 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-R9HTTPRequestTests/Pods-R9HTTPRequestTests-resources.sh\"\n"; 278 | showEnvVarsInLog = 0; 279 | }; 280 | 3CBEB8D44FCA27148E4ED583 /* [CP] Check Pods Manifest.lock */ = { 281 | isa = PBXShellScriptBuildPhase; 282 | buildActionMask = 2147483647; 283 | files = ( 284 | ); 285 | inputPaths = ( 286 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 287 | "${PODS_ROOT}/Manifest.lock", 288 | ); 289 | name = "[CP] Check Pods Manifest.lock"; 290 | outputPaths = ( 291 | "$(DERIVED_FILE_DIR)/Pods-R9HTTPRequest-checkManifestLockResult.txt", 292 | ); 293 | runOnlyForDeploymentPostprocessing = 0; 294 | shellPath = /bin/sh; 295 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 296 | showEnvVarsInLog = 0; 297 | }; 298 | 52E1C37A62C8EE153FD1EDC0 /* [CP] Copy Pods Resources */ = { 299 | isa = PBXShellScriptBuildPhase; 300 | buildActionMask = 2147483647; 301 | files = ( 302 | ); 303 | inputPaths = ( 304 | ); 305 | name = "[CP] Copy Pods Resources"; 306 | outputPaths = ( 307 | ); 308 | runOnlyForDeploymentPostprocessing = 0; 309 | shellPath = /bin/sh; 310 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-R9HTTPRequest/Pods-R9HTTPRequest-resources.sh\"\n"; 311 | showEnvVarsInLog = 0; 312 | }; 313 | A21F871CFB97D53B2614A437 /* [CP] Check Pods Manifest.lock */ = { 314 | isa = PBXShellScriptBuildPhase; 315 | buildActionMask = 2147483647; 316 | files = ( 317 | ); 318 | inputPaths = ( 319 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 320 | "${PODS_ROOT}/Manifest.lock", 321 | ); 322 | name = "[CP] Check Pods Manifest.lock"; 323 | outputPaths = ( 324 | "$(DERIVED_FILE_DIR)/Pods-R9HTTPRequestTests-checkManifestLockResult.txt", 325 | ); 326 | runOnlyForDeploymentPostprocessing = 0; 327 | shellPath = /bin/sh; 328 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 329 | showEnvVarsInLog = 0; 330 | }; 331 | /* End PBXShellScriptBuildPhase section */ 332 | 333 | /* Begin PBXSourcesBuildPhase section */ 334 | DAACBFC21F832F1B00B4F275 /* Sources */ = { 335 | isa = PBXSourcesBuildPhase; 336 | buildActionMask = 2147483647; 337 | files = ( 338 | DAACBFE61F83631C00B4F275 /* HttpJsonClient.swift in Sources */, 339 | DAACBFE41F83312100B4F275 /* HTTPClient.swift in Sources */, 340 | DAACBFE81F8364D800B4F275 /* HttpDataClient.swift in Sources */, 341 | ); 342 | runOnlyForDeploymentPostprocessing = 0; 343 | }; 344 | DAACBFCC1F832F1B00B4F275 /* Sources */ = { 345 | isa = PBXSourcesBuildPhase; 346 | buildActionMask = 2147483647; 347 | files = ( 348 | DAACBFEA1F8369DF00B4F275 /* HttpbinResponse.swift in Sources */, 349 | DAACBFD61F832F1B00B4F275 /* R9HTTPRequestTests.swift in Sources */, 350 | ); 351 | runOnlyForDeploymentPostprocessing = 0; 352 | }; 353 | /* End PBXSourcesBuildPhase section */ 354 | 355 | /* Begin PBXTargetDependency section */ 356 | DAACBFD31F832F1B00B4F275 /* PBXTargetDependency */ = { 357 | isa = PBXTargetDependency; 358 | target = DAACBFC61F832F1B00B4F275 /* R9HTTPRequest */; 359 | targetProxy = DAACBFD21F832F1B00B4F275 /* PBXContainerItemProxy */; 360 | }; 361 | /* End PBXTargetDependency section */ 362 | 363 | /* Begin XCBuildConfiguration section */ 364 | DAACBFD91F832F1B00B4F275 /* Debug */ = { 365 | isa = XCBuildConfiguration; 366 | buildSettings = { 367 | ALWAYS_SEARCH_USER_PATHS = NO; 368 | CLANG_ANALYZER_NONNULL = YES; 369 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 370 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 371 | CLANG_CXX_LIBRARY = "libc++"; 372 | CLANG_ENABLE_MODULES = YES; 373 | CLANG_ENABLE_OBJC_ARC = YES; 374 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 375 | CLANG_WARN_BOOL_CONVERSION = YES; 376 | CLANG_WARN_COMMA = YES; 377 | CLANG_WARN_CONSTANT_CONVERSION = YES; 378 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 379 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 380 | CLANG_WARN_EMPTY_BODY = YES; 381 | CLANG_WARN_ENUM_CONVERSION = YES; 382 | CLANG_WARN_INFINITE_RECURSION = YES; 383 | CLANG_WARN_INT_CONVERSION = YES; 384 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 385 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 386 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 387 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 388 | CLANG_WARN_STRICT_PROTOTYPES = YES; 389 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 390 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 391 | CLANG_WARN_UNREACHABLE_CODE = YES; 392 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 393 | CODE_SIGN_IDENTITY = "iPhone Developer"; 394 | COPY_PHASE_STRIP = NO; 395 | CURRENT_PROJECT_VERSION = 1; 396 | DEBUG_INFORMATION_FORMAT = dwarf; 397 | ENABLE_STRICT_OBJC_MSGSEND = YES; 398 | ENABLE_TESTABILITY = YES; 399 | GCC_C_LANGUAGE_STANDARD = gnu11; 400 | GCC_DYNAMIC_NO_PIC = NO; 401 | GCC_NO_COMMON_BLOCKS = YES; 402 | GCC_OPTIMIZATION_LEVEL = 0; 403 | GCC_PREPROCESSOR_DEFINITIONS = ( 404 | "DEBUG=1", 405 | "$(inherited)", 406 | ); 407 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 408 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 409 | GCC_WARN_UNDECLARED_SELECTOR = YES; 410 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 411 | GCC_WARN_UNUSED_FUNCTION = YES; 412 | GCC_WARN_UNUSED_VARIABLE = YES; 413 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 414 | MTL_ENABLE_DEBUG_INFO = YES; 415 | ONLY_ACTIVE_ARCH = YES; 416 | SDKROOT = iphoneos; 417 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 418 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 419 | VERSIONING_SYSTEM = "apple-generic"; 420 | VERSION_INFO_PREFIX = ""; 421 | }; 422 | name = Debug; 423 | }; 424 | DAACBFDA1F832F1B00B4F275 /* Release */ = { 425 | isa = XCBuildConfiguration; 426 | buildSettings = { 427 | ALWAYS_SEARCH_USER_PATHS = NO; 428 | CLANG_ANALYZER_NONNULL = YES; 429 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 430 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 431 | CLANG_CXX_LIBRARY = "libc++"; 432 | CLANG_ENABLE_MODULES = YES; 433 | CLANG_ENABLE_OBJC_ARC = YES; 434 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 435 | CLANG_WARN_BOOL_CONVERSION = YES; 436 | CLANG_WARN_COMMA = YES; 437 | CLANG_WARN_CONSTANT_CONVERSION = YES; 438 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 439 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 440 | CLANG_WARN_EMPTY_BODY = YES; 441 | CLANG_WARN_ENUM_CONVERSION = YES; 442 | CLANG_WARN_INFINITE_RECURSION = YES; 443 | CLANG_WARN_INT_CONVERSION = YES; 444 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 445 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 446 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 447 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 448 | CLANG_WARN_STRICT_PROTOTYPES = YES; 449 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 450 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 451 | CLANG_WARN_UNREACHABLE_CODE = YES; 452 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 453 | CODE_SIGN_IDENTITY = "iPhone Developer"; 454 | COPY_PHASE_STRIP = NO; 455 | CURRENT_PROJECT_VERSION = 1; 456 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 457 | ENABLE_NS_ASSERTIONS = NO; 458 | ENABLE_STRICT_OBJC_MSGSEND = YES; 459 | GCC_C_LANGUAGE_STANDARD = gnu11; 460 | GCC_NO_COMMON_BLOCKS = YES; 461 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 462 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 463 | GCC_WARN_UNDECLARED_SELECTOR = YES; 464 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 465 | GCC_WARN_UNUSED_FUNCTION = YES; 466 | GCC_WARN_UNUSED_VARIABLE = YES; 467 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 468 | MTL_ENABLE_DEBUG_INFO = NO; 469 | SDKROOT = iphoneos; 470 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 471 | VALIDATE_PRODUCT = YES; 472 | VERSIONING_SYSTEM = "apple-generic"; 473 | VERSION_INFO_PREFIX = ""; 474 | }; 475 | name = Release; 476 | }; 477 | DAACBFDC1F832F1B00B4F275 /* Debug */ = { 478 | isa = XCBuildConfiguration; 479 | baseConfigurationReference = 77F0207A298B2127E9281D5F /* Pods-R9HTTPRequest.debug.xcconfig */; 480 | buildSettings = { 481 | CLANG_ENABLE_MODULES = YES; 482 | CODE_SIGN_IDENTITY = ""; 483 | CODE_SIGN_STYLE = Automatic; 484 | DEFINES_MODULE = YES; 485 | DYLIB_COMPATIBILITY_VERSION = 1; 486 | DYLIB_CURRENT_VERSION = 1; 487 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 488 | INFOPLIST_FILE = R9HTTPRequest/Info.plist; 489 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 490 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 491 | PRODUCT_BUNDLE_IDENTIFIER = com.9revolution9.R9HTTPRequest; 492 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 493 | SKIP_INSTALL = YES; 494 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 495 | SWIFT_VERSION = 4.0; 496 | TARGETED_DEVICE_FAMILY = "1,2"; 497 | }; 498 | name = Debug; 499 | }; 500 | DAACBFDD1F832F1B00B4F275 /* Release */ = { 501 | isa = XCBuildConfiguration; 502 | baseConfigurationReference = D670887EA37A2A7FC63992AD /* Pods-R9HTTPRequest.release.xcconfig */; 503 | buildSettings = { 504 | CLANG_ENABLE_MODULES = YES; 505 | CODE_SIGN_IDENTITY = ""; 506 | CODE_SIGN_STYLE = Automatic; 507 | DEFINES_MODULE = YES; 508 | DYLIB_COMPATIBILITY_VERSION = 1; 509 | DYLIB_CURRENT_VERSION = 1; 510 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 511 | INFOPLIST_FILE = R9HTTPRequest/Info.plist; 512 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 513 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 514 | PRODUCT_BUNDLE_IDENTIFIER = com.9revolution9.R9HTTPRequest; 515 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 516 | SKIP_INSTALL = YES; 517 | SWIFT_VERSION = 4.0; 518 | TARGETED_DEVICE_FAMILY = "1,2"; 519 | }; 520 | name = Release; 521 | }; 522 | DAACBFDF1F832F1B00B4F275 /* Debug */ = { 523 | isa = XCBuildConfiguration; 524 | baseConfigurationReference = 4262D436890A3823A01B4D0E /* Pods-R9HTTPRequestTests.debug.xcconfig */; 525 | buildSettings = { 526 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; 527 | CODE_SIGN_STYLE = Manual; 528 | DEVELOPMENT_TEAM = ""; 529 | INFOPLIST_FILE = R9HTTPRequestTests/Info.plist; 530 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 531 | PRODUCT_BUNDLE_IDENTIFIER = com.9revolution9.R9HTTPRequestTests; 532 | PRODUCT_NAME = "$(TARGET_NAME)"; 533 | PROVISIONING_PROFILE_SPECIFIER = ""; 534 | SWIFT_VERSION = 4.0; 535 | TARGETED_DEVICE_FAMILY = "1,2"; 536 | }; 537 | name = Debug; 538 | }; 539 | DAACBFE01F832F1B00B4F275 /* Release */ = { 540 | isa = XCBuildConfiguration; 541 | baseConfigurationReference = 7F8E6B3192C5CC820D3319D4 /* Pods-R9HTTPRequestTests.release.xcconfig */; 542 | buildSettings = { 543 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; 544 | CODE_SIGN_STYLE = Manual; 545 | DEVELOPMENT_TEAM = ""; 546 | INFOPLIST_FILE = R9HTTPRequestTests/Info.plist; 547 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 548 | PRODUCT_BUNDLE_IDENTIFIER = com.9revolution9.R9HTTPRequestTests; 549 | PRODUCT_NAME = "$(TARGET_NAME)"; 550 | PROVISIONING_PROFILE_SPECIFIER = ""; 551 | SWIFT_VERSION = 4.0; 552 | TARGETED_DEVICE_FAMILY = "1,2"; 553 | }; 554 | name = Release; 555 | }; 556 | /* End XCBuildConfiguration section */ 557 | 558 | /* Begin XCConfigurationList section */ 559 | DAACBFC11F832F1B00B4F275 /* Build configuration list for PBXProject "R9HTTPRequest" */ = { 560 | isa = XCConfigurationList; 561 | buildConfigurations = ( 562 | DAACBFD91F832F1B00B4F275 /* Debug */, 563 | DAACBFDA1F832F1B00B4F275 /* Release */, 564 | ); 565 | defaultConfigurationIsVisible = 0; 566 | defaultConfigurationName = Release; 567 | }; 568 | DAACBFDB1F832F1B00B4F275 /* Build configuration list for PBXNativeTarget "R9HTTPRequest" */ = { 569 | isa = XCConfigurationList; 570 | buildConfigurations = ( 571 | DAACBFDC1F832F1B00B4F275 /* Debug */, 572 | DAACBFDD1F832F1B00B4F275 /* Release */, 573 | ); 574 | defaultConfigurationIsVisible = 0; 575 | defaultConfigurationName = Release; 576 | }; 577 | DAACBFDE1F832F1B00B4F275 /* Build configuration list for PBXNativeTarget "R9HTTPRequestTests" */ = { 578 | isa = XCConfigurationList; 579 | buildConfigurations = ( 580 | DAACBFDF1F832F1B00B4F275 /* Debug */, 581 | DAACBFE01F832F1B00B4F275 /* Release */, 582 | ); 583 | defaultConfigurationIsVisible = 0; 584 | defaultConfigurationName = Release; 585 | }; 586 | /* End XCConfigurationList section */ 587 | }; 588 | rootObject = DAACBFBE1F832F1B00B4F275 /* Project object */; 589 | } 590 | -------------------------------------------------------------------------------- /R9HTTPRequest.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /R9HTTPRequest.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /R9HTTPRequest.xcworkspace/xcuserdata/taisuke.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glassonion1/R9HTTPRequest/beb9b87392e7fc1363cbf70bb3d274288bcbcdad/R9HTTPRequest.xcworkspace/xcuserdata/taisuke.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /R9HTTPRequest.xcworkspace/xcuserdata/taisukefujita.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/glassonion1/R9HTTPRequest/beb9b87392e7fc1363cbf70bb3d274288bcbcdad/R9HTTPRequest.xcworkspace/xcuserdata/taisukefujita.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /R9HTTPRequest.xcworkspace/xcuserdata/taisukefujita.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /R9HTTPRequest/HTTPClient.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPClient.swift 3 | // R9HTTPRequest 4 | // 5 | // Created by taisuke fujita on 2017/10/03. 6 | // Copyright © 2017年 Revolution9. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import RxSwift 11 | 12 | /// A dictionary of headers to apply to a `URLRequest`. 13 | public typealias HTTPHeaders = [String: String] 14 | 15 | public enum HttpClientMethodType: String { 16 | case get = "GET" 17 | case post = "POST" 18 | case put = "PUT" 19 | case patch = "PATCH" 20 | case delete = "DELETE" 21 | } 22 | 23 | public protocol HttpClient { 24 | associatedtype ResponseType 25 | 26 | func get(url: URL, headers: HTTPHeaders?) -> Observable 27 | func post(url: URL, requestBody: String?, headers: HTTPHeaders?) -> Observable 28 | func put(url: URL, requestBody: String?, headers: HTTPHeaders?) -> Observable 29 | func patch(url: URL, requestBody: String?, headers: HTTPHeaders?) -> Observable 30 | func delete(url: URL, headers: HTTPHeaders?) -> Observable 31 | func action(method: HttpClientMethodType, url: URL, requestBody: Data?, headers: HTTPHeaders?) -> Observable 32 | } 33 | 34 | public extension HttpClient { 35 | 36 | public func get(url: URL, headers: HTTPHeaders?) -> Observable { 37 | return action(method: .get, url: url, requestBody: nil, headers: headers) 38 | } 39 | 40 | public func post(url: URL, requestBody: String?, headers: HTTPHeaders?) -> Observable { 41 | return action(method: .post, url: url, requestBody: requestBody?.data(using: .utf8), headers: headers) 42 | } 43 | 44 | public func put(url: URL, requestBody: String?, headers: HTTPHeaders?) -> Observable { 45 | return action(method: .put, url: url, requestBody: requestBody?.data(using: .utf8), headers: headers) 46 | } 47 | 48 | public func patch(url: URL, requestBody: String?, headers: HTTPHeaders?) -> Observable { 49 | return action(method: .patch, url: url, requestBody: requestBody?.data(using: .utf8), headers: headers) 50 | } 51 | 52 | public func delete(url: URL, headers: HTTPHeaders?) -> Observable { 53 | return action(method: .delete, url: url, requestBody: nil, headers: headers) 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /R9HTTPRequest/HttpDataClient.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HttpDataClient.swift 3 | // R9HTTPRequest 4 | // 5 | // Created by taisuke fujita on 2017/10/03. 6 | // Copyright © 2017年 Revolution9. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import RxSwift 11 | import RxCocoa 12 | 13 | public class HttpDataClient: HttpClient { 14 | 15 | public typealias ResponseType = Data 16 | 17 | public init() { 18 | 19 | } 20 | 21 | public func action(method: HttpClientMethodType, url: URL, requestBody: Data?, headers: HTTPHeaders?) -> Observable { 22 | var request = URLRequest(url: url) 23 | request.httpMethod = method.rawValue 24 | request.allHTTPHeaderFields = headers 25 | request.addValue("application/octet-stream", forHTTPHeaderField: "Content-Type") 26 | request.httpBody = requestBody 27 | let scheduler = ConcurrentDispatchQueueScheduler(qos: .background) 28 | return URLSession.shared.rx.data(request: request).timeout(30, scheduler: scheduler) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /R9HTTPRequest/HttpJsonClient.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HttpJsonClient.swift 3 | // R9HTTPRequest 4 | // 5 | // Created by taisuke fujita on 2017/10/03. 6 | // Copyright © 2017年 Revolution9. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import RxSwift 11 | import RxCocoa 12 | 13 | public class HttpJsonClient: HttpClient { 14 | 15 | public typealias ResponseType = T 16 | 17 | public init() { 18 | 19 | } 20 | 21 | public func action(method: HttpClientMethodType, url: URL, requestBody: Data?, headers: HTTPHeaders?) -> Observable { 22 | var request = URLRequest(url: url, cachePolicy: .reloadIgnoringCacheData) 23 | request.httpMethod = method.rawValue 24 | request.allHTTPHeaderFields = headers 25 | request.addValue("application/json", forHTTPHeaderField: "Content-Type") 26 | request.httpBody = requestBody 27 | let scheduler = ConcurrentDispatchQueueScheduler(qos: .background) 28 | return URLSession.shared.rx.data(request: request).timeout(30, scheduler: scheduler).map { data -> T in 29 | let jsonDecoder = JSONDecoder() 30 | let response = try! jsonDecoder.decode(T.self, from: data) 31 | return response 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /R9HTTPRequest/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 2.0.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /R9HTTPRequest/R9HTTPRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // R9HTTPRequest.h 3 | // R9HTTPRequest 4 | // 5 | // Created by taisuke fujita on 2017/10/03. 6 | // Copyright © 2017年 Revolution9. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for R9HTTPRequest. 12 | FOUNDATION_EXPORT double R9HTTPRequestVersionNumber; 13 | 14 | //! Project version string for R9HTTPRequest. 15 | FOUNDATION_EXPORT const unsigned char R9HTTPRequestVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /R9HTTPRequestTests/HttpbinResponse.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HttpbinResponse.swift 3 | // R9HTTPRequestTests 4 | // 5 | // Created by taisuke fujita on 2017/10/03. 6 | // Copyright © 2017年 Revolution9. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | struct HttpbinResponse: Codable { 12 | var origin = "" 13 | var url = "" 14 | } 15 | -------------------------------------------------------------------------------- /R9HTTPRequestTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /R9HTTPRequestTests/R9HTTPRequestTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // R9HTTPRequestTests.swift 3 | // R9HTTPRequestTests 4 | // 5 | // Created by taisuke fujita on 2017/10/03. 6 | // Copyright © 2017年 Revolution9. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | import RxSwift 11 | import RxCocoa 12 | @testable import R9HTTPRequest 13 | 14 | class R9HTTPRequestTests: XCTestCase { 15 | 16 | let disposeBag = DisposeBag() 17 | 18 | override func setUp() { 19 | super.setUp() 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | override func tearDown() { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | super.tearDown() 26 | } 27 | 28 | func testGet() { 29 | let promiseToCallBack = expectation(description: "calls back") 30 | 31 | let client = HttpJsonClient() 32 | let url = URL(string: "http://httpbin.org/get")! 33 | 34 | client.get(url: url, headers: nil) 35 | .subscribe(onNext: { response -> Void in 36 | XCTAssert(response.url == "http://httpbin.org/get") 37 | XCTAssert(!Thread.isMainThread) 38 | }, onCompleted: { 39 | promiseToCallBack.fulfill() 40 | }).disposed(by: disposeBag) 41 | 42 | self.waitForExpectations(timeout: 10, handler: nil) 43 | } 44 | 45 | func testMultipleGet() { 46 | let promiseToCallBack = expectation(description: "calls back") 47 | 48 | let client = HttpJsonClient() 49 | let url = URL(string: "http://httpbin.org/get")! 50 | let url2 = URL(string: "http://httpbin.org/get")! 51 | 52 | var count = 0 53 | Observable.of(client.get(url: url, headers: nil), client.get(url: url2, headers: nil)) 54 | .merge() 55 | .subscribe(onNext: { value -> Void in 56 | print(value) 57 | count += 1 58 | XCTAssert(!Thread.isMainThread) 59 | }, onCompleted: { 60 | XCTAssert(count == 2) 61 | promiseToCallBack.fulfill() 62 | }).disposed(by: disposeBag) 63 | 64 | self.waitForExpectations(timeout: 10, handler: nil) 65 | } 66 | 67 | func testPost() { 68 | let promiseToCallBack = expectation(description: "calls back") 69 | 70 | let client = HttpJsonClient() 71 | let url = URL(string: "http://httpbin.org/post")! 72 | 73 | client.post(url: url, requestBody: nil, headers: nil) 74 | .subscribe(onNext: { response -> Void in 75 | XCTAssert(response.url == "http://httpbin.org/post") 76 | XCTAssert(!Thread.isMainThread) 77 | }, onCompleted: { 78 | promiseToCallBack.fulfill() 79 | }).disposed(by: disposeBag) 80 | 81 | self.waitForExpectations(timeout: 10, handler: nil) 82 | } 83 | 84 | func testPut() { 85 | let promiseToCallBack = expectation(description: "calls back") 86 | 87 | let client = HttpJsonClient() 88 | let url = URL(string: "http://httpbin.org/put")! 89 | 90 | client.put(url: url, requestBody: nil, headers: nil) 91 | .subscribe(onNext: { response -> Void in 92 | XCTAssert(response.url == "http://httpbin.org/put") 93 | XCTAssert(!Thread.isMainThread) 94 | }, onCompleted: { 95 | promiseToCallBack.fulfill() 96 | }).disposed(by: disposeBag) 97 | 98 | self.waitForExpectations(timeout: 10, handler: nil) 99 | } 100 | 101 | func testPatch() { 102 | let promiseToCallBack = expectation(description: "calls back") 103 | 104 | let client = HttpJsonClient() 105 | let url = URL(string: "http://httpbin.org/patch")! 106 | 107 | client.patch(url: url, requestBody: nil, headers: nil) 108 | .subscribe(onNext: { response -> Void in 109 | XCTAssert(response.url == "http://httpbin.org/patch") 110 | XCTAssert(!Thread.isMainThread) 111 | }, onCompleted: { 112 | promiseToCallBack.fulfill() 113 | }).disposed(by: disposeBag) 114 | 115 | self.waitForExpectations(timeout: 10, handler: nil) 116 | } 117 | 118 | func testDelete() { 119 | let promiseToCallBack = expectation(description: "calls back") 120 | 121 | let client = HttpJsonClient() 122 | let url = URL(string: "http://httpbin.org/delete")! 123 | 124 | client.delete(url: url, headers: nil) 125 | .subscribe(onNext: { response -> Void in 126 | XCTAssert(response.url == "http://httpbin.org/delete") 127 | XCTAssert(!Thread.isMainThread) 128 | }, onCompleted: { 129 | promiseToCallBack.fulfill() 130 | }).disposed(by: disposeBag) 131 | 132 | self.waitForExpectations(timeout: 10, handler: nil) 133 | } 134 | 135 | func testError() { 136 | let promiseToCallBack = expectation(description: "calls back") 137 | 138 | let client = HttpJsonClient() 139 | let url = URL(string: "http://httpbin.org/status/500")! 140 | 141 | client.get(url: url, headers: nil) 142 | .subscribe(onNext: { response -> Void in 143 | XCTFail() 144 | }, onError: { error in 145 | if let rxerror = error as? RxCocoaURLError, 146 | case .httpRequestFailed(let response, _) = rxerror { 147 | XCTAssert(response.statusCode == 500) 148 | } else { 149 | XCTFail() 150 | } 151 | promiseToCallBack.fulfill() 152 | }, onCompleted: { 153 | XCTFail() 154 | }).disposed(by: disposeBag) 155 | 156 | self.waitForExpectations(timeout: 10, handler: nil) 157 | } 158 | 159 | func testHtmlPage() { 160 | let promiseToCallBack = expectation(description: "calls back") 161 | 162 | let client = HttpDataClient() 163 | let url = URL(string: "http://httpbin.org/html")! 164 | 165 | client.get(url: url, headers: nil) 166 | .subscribe(onNext: { response -> Void in 167 | if let html = String(data: response, encoding: .utf8) { 168 | print(html) 169 | XCTAssert(html != "") 170 | } else { 171 | XCTFail() 172 | } 173 | XCTAssert(!Thread.isMainThread) 174 | }, onCompleted: { 175 | promiseToCallBack.fulfill() 176 | }).disposed(by: disposeBag) 177 | 178 | self.waitForExpectations(timeout: 10, handler: nil) 179 | } 180 | } 181 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # R9HTTPRequest 2 | 3 | [![Version](https://img.shields.io/cocoapods/v/R9HTTPRequest.svg?style=flat)](http://cocoapods.org/pods/R9HTTPRequest) 4 | [![License](https://img.shields.io/cocoapods/l/R9HTTPRequest.svg?style=flat)](http://cocoapods.org/pods/R9HTTPRequest) 5 | [![Platform](https://img.shields.io/cocoapods/p/R9HTTPRequest.svg?style=flat)](http://cocoapods.org/pods/R9HTTPRequest) 6 | [![Build Status](https://travis-ci.org/glassonion1/R9HTTPRequest.svg?branch=master)](https://travis-ci.org/glassonion1/R9HTTPRequest) 7 | 8 | R9HTTPRequest is an easy to use wrapper around the URLSession(a.k.a NSURLSession) API that makes some of the more tedious aspects of communicating with web servers easier. 9 | It's backed by RxSwift and RxCocoa. 10 | 11 | # Feature 12 | 13 | ## REST API Client 14 | 15 | It is suitable performing basic HTTP requests and interacting with REST-based services (GET / POST / PUT / DELETE). 16 | 17 | ``` 18 | let disposeBag = DisposeBag() 19 | 20 | let client = HttpJsonClient() 21 | let url = URL(string: "http://httpbin.org/get")! 22 | 23 | client.get(url: url, headers: nil) 24 | .subscribe(onNext: { response -> Void in 25 | // 26 | }).disposed(by: disposeBag) 27 | 28 | struct HttpResponse: Codable { 29 | var id = "" 30 | var name = "" 31 | 32 | // ... // 33 | } 34 | ``` 35 | 36 | # Installation 37 | 38 | ## CocoaPods 39 | 40 | You can install R9HTTPRequest via CocoaPods by adding it to your Podfile: 41 | 42 | ``` 43 | use_frameworks! 44 | 45 | source 'https://github.com/CocoaPods/Specs.git' 46 | platform :ios, '11.0' 47 | 48 | pod 'R9HTTPRequest' 49 | ``` 50 | --------------------------------------------------------------------------------