Skip to content

Commit

Permalink
latest PromiseKit & OMGHTTPURLRQ
Browse files Browse the repository at this point in the history
  • Loading branch information
dezinezync committed Sep 4, 2015
1 parent 83a9030 commit cd8e831
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "mxcl/PromiseKit" "swift-2.0-beta5"
github "mxcl/OMGHTTPURLRQ" ~> 2.1.3
github "mxcl/OMGHTTPURLRQ"
4 changes: 2 additions & 2 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "mxcl/OMGHTTPURLRQ" "2.1.3"
github "mxcl/PromiseKit" "2.1.1"
github "mxcl/OMGHTTPURLRQ" "3.0.0"
github "mxcl/PromiseKit" "0881d5c09d7c8bbdb4b3b83151032bd18d27eed9"
7 changes: 6 additions & 1 deletion DZNetworking.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@
F0FC8E471B4FB1D300FDA46C /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0640;
LastUpgradeCheck = 0700;
ORGANIZATIONNAME = "Dezine Zync Studios LLP.";
TargetAttributes = {
F0FC8E4F1B4FB1D300FDA46C = {
Expand Down Expand Up @@ -411,6 +411,7 @@
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down Expand Up @@ -501,6 +502,7 @@
);
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = "com.dezinezync.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
};
Expand Down Expand Up @@ -529,6 +531,7 @@
"$(SDKROOT)/usr/lib/system",
);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = "com.dezinezync.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
};
Expand All @@ -551,6 +554,7 @@
);
INFOPLIST_FILE = DZNetworkingTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.dezinezync.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
Expand All @@ -568,6 +572,7 @@
);
INFOPLIST_FILE = DZNetworkingTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.dezinezync.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0640"
LastUpgradeVersion = "0700"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -37,10 +37,10 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -62,15 +62,18 @@
ReferencedContainer = "container:DZNetworking.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
Expand All @@ -85,10 +88,10 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
Expand Down
16 changes: 8 additions & 8 deletions DZNetworking/Core/DZURLSession.m
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ - (DZPromise *)POST:(NSString *)URI
id queryString = OMGFormURLEncode(query);
if (queryString) url = [url stringByAppendingFormat:@"?%@", queryString];

NSMutableURLRequest *req = [OMGHTTPURLRQ POST:url :params];
NSMutableURLRequest *req = [OMGHTTPURLRQ POST:url :params error:nil];

if(self.requestModifier)
{
Expand Down Expand Up @@ -158,7 +158,7 @@ - (DZPromise *)PUT:(NSString *)URI
id queryString = OMGFormURLEncode(query);
if (queryString) url = [url stringByAppendingFormat:@"?%@", queryString];

NSMutableURLRequest *req = [OMGHTTPURLRQ PUT:url :params];
NSMutableURLRequest *req = [OMGHTTPURLRQ PUT:url :params error:nil];

if(self.requestModifier)
{
Expand Down Expand Up @@ -303,31 +303,31 @@ - (DZPromise *)requestWithURI:(NSString *)URI
params:(NSDictionary *)params
{

return [PMKPromise promiseWithResolverBlock:^(PMKResolver resolve) {
return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) {

NSString *url = [NSURL URLWithString:URI relativeToURL:self.baseURL].absoluteString;

NSMutableURLRequest *mutableRequest;

if([method isEqualToString:@"GET"])
{
mutableRequest = [OMGHTTPURLRQ GET:url :params];
mutableRequest = [OMGHTTPURLRQ GET:url :params error:nil];
}
else if([method isEqualToString:@"POST"])
{
mutableRequest = [OMGHTTPURLRQ POST:url :params];
mutableRequest = [OMGHTTPURLRQ POST:url :params error:nil];
}
else if([method isEqualToString:@"PUT"])
{
mutableRequest = [OMGHTTPURLRQ PUT:url :params];
mutableRequest = [OMGHTTPURLRQ PUT:url :params error:nil];
}
else if([method isEqualToString:@"DELETE"])
{
mutableRequest = [OMGHTTPURLRQ DELETE:url :params];
mutableRequest = [OMGHTTPURLRQ DELETE:url :params error:nil];
}
else
{
mutableRequest = [OMGHTTPURLRQ GET:url :params];
mutableRequest = [OMGHTTPURLRQ GET:url :params error:nil];
mutableRequest.HTTPMethod = method;
}

Expand Down
2 changes: 1 addition & 1 deletion DZNetworking/Core/DZUploadSession.m
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ - (DZPromise *)UPLOAD:(NSString *)path
[processed addParameters:params];
}

NSMutableURLRequest *request = [OMGHTTPURLRQ POST:URL :processed];
NSMutableURLRequest *request = [OMGHTTPURLRQ POST:URL :processed error:nil];

resolve(request);

Expand Down
2 changes: 1 addition & 1 deletion DZNetworking/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.dezinezync.$(PRODUCT_NAME:rfc1034identifier)</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand Down
2 changes: 1 addition & 1 deletion DZNetworkingTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.dezinezync.$(PRODUCT_NAME:rfc1034identifier)</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand Down

0 comments on commit cd8e831

Please sign in to comment.