title: Modify Request of webView shouldStartLoadWithRequest:
body: <p>Currently I am developing an hybrid app which uses webView shouldStartLoadWithRequest: to provide a token for the login. My function works fine for every normal request I make (a click e.g.) </p>
  
  <pre><code> - (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request 
          NSLog([NSString stringWithFormat:@"Loading View: %@",[[request URL] absoluteString]]);
          if ([[[request URL] absoluteString] rangeOfString:BASE_URL].location != NSNotFound) {
              NSString *token = [[NSUserDefaults standardUserDefaults] stringForKey:kDefaultsKeyLoginToken];
              NSString *hash = [[NSUserDefaults standardUserDefaults] stringForKey:kDefaultsKeyLoginHash];
              NSString *params = [NSString stringWithFormat:@"mobile=app&amp;user_token=%@&amp;user_hash=%@",token,hash];
              if([[request URL] query] == nil) {
                  [self LoadUrl:[[request URL] absoluteString] withGetParams:params append:NO];
                  return NO;
              }else{
                  if([[[request URL] absoluteString] rangeOfString:params].location == NSNotFound){
                      [self LoadUrl:[[request URL] absoluteString] withGetParams:params append:YES];
                      return NO;
                  }
              }
  
      }
  
  -(void)LoadUrl:(NSString *)url withGetParams:(NSString *)params append:(BOOL)append{
      NSString *PreUrl;
      if(append == YES) PreUrl = [NSString stringWithFormat:@"%@&amp;%@",url,params];
      else  PreUrl = [NSString stringWithFormat:@"%@?%@",url,params];
      NSURL *nsurl = [NSURL URLWithString: PreUrl];
      NSURLRequest *request = [NSURLRequest requestWithURL:nsurl];
      [self.WebView loadRequest:request];
  }
  </code></pre>
  
  <p>The Problem I have with this Code is that if I load an Image e.g. it will be detected as "to be hashed-appended" (which is correct, I want every request to have the Auth included) BUT the Image will get loaded in the Webview itself. </p>
  
  <p>My first try (before I switched to this model) was to modify the request parsed. But every change got Ignored.... </p>
  
  <p>Has anyone an Idea how I could fix this problem? Is there a way to really modify requests? Or if not, can I at least determine the "target" of the request or forward it?</p>
  
  <p>Thanks for any help</p>