title: iOS how to deal with spaces or special characters passed to AFHTTPSessionManager GET method?
body: <p>I have an instance of <code>AFHTTPSessionManager</code> responsible for making a GET request. One of parameters in the request - name can have spaces in it or potentially other characters that might not be acceptable in a URL. </p>
  
  <p>I see that <code>AFHTTPSessionManager</code> does not automatically replace spaces with the appropriate %symbol, so the request below will fail. <strong>How can I process my string to turn it into a URL compatible string?</strong> <code>test user to test%20user</code></p>
  
  <p>I can do string by replacing occurences of string, but am looking for a more generic method to handle all not-url safe characters.</p>
  
  <pre><code>NSURL* baseURL = [NSURL URLWithString:[APP_DELEGATE hostString]];
  
  AFHTTPSessionManager *manager = [[AFHTTPSessionManager alloc] initWithBaseURL:baseURL];
  
  //is there a way for me
  NSString* path = @"user/?name=test user"
  
  [manager GET:path parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
      DLog(@"Success: %@",responseObject);
  } failure:^(NSURLSessionDataTask *task, NSError *error) {
      DLog(@"Failure:  %@",error);
  }];
  </code></pre>