Permalink
Browse files

Switched url to post (for credentials as url params)

  • Loading branch information...
gabehamilton committed Mar 12, 2015
1 parent 1e310f3 commit d6c290cd71ff5334ba7df59046c8137ba6b9ad4b
Showing with 24 additions and 15 deletions.
  1. +3 −0 .gitignore
  2. +21 −15 WebSaverView.m
@@ -0,0 +1,3 @@
WebSaver.xcodeproj/project.xcworkspace/xcshareddata/WebSaver.xccheckout
WebSaver.xcodeproj/project.xcworkspace/xcuserdata
WebSaver.xcodeproj/xcuserdata
@@ -190,23 +190,16 @@ - (void)startAnimation
} else {
url = saverURLString;
}


// Reload the page and reset load time
[[webView mainFrame] loadRequest:[NSURLRequest requestWithURL: [NSURL URLWithString:url]]];
lastLoad = [[NSDate alloc] init];
NSLog(@"reloaded %@",[lastLoad description]);

[self loadUrl];

}

- (void)stopAnimation
{
DebugLog(@"webView:stopAnimation");

// Reload the page and reset load time
[[webView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"about:"]]];
lastLoad = [[NSDate alloc] init];
DebugLog(@"reloaded %@",[lastLoad description]);
[self loadUrl];

[super stopAnimation];
}
@@ -374,13 +367,26 @@ - (IBAction)okClick:(id)sender
[defaults setBool:enableMultiMonitorBool forKey:@"EnableMultiMonitor"];
[defaults synchronize];

// Reload the page and reset load time
[[webView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:saverURLString]]];
lastLoad = [[NSDate alloc] init];
DebugLog(@"reloaded %@",[lastLoad description]);

[self loadUrl];

// Close the window
[[NSApplication sharedApplication] endSheet:configSheet];
}
- (void)loadUrl
{
// Reload the page and reset load time
NSMutableURLRequest *request =
[NSMutableURLRequest requestWithURL:[NSURL URLWithString:saverURLString]];
[request setHTTPMethod:@"POST"];

// NSString *postString = @"Some post string";
// [request setHTTPBody:[postString dataUsingEncoding:NSUTF8StringEncoding]];

[[webView mainFrame] loadRequest:request];
lastLoad = [[NSDate alloc] init];
DebugLog(@"reloaded %@",[lastLoad description]);

}


@end

0 comments on commit d6c290c

Please sign in to comment.