title: unsupported URL error code -1002
body: <p>Hi Please help me how to prepare NSMutableURLRequest for below api</p>
  
  <p>URL : www.XXXXXXXX.com/api.php</p>
  
  <p>For Login :-</p>
  
  <p>www.XXXXXXXXXXXX.com/api.php?task=login</p>
  
  <p>POST Data :-</p>
  
  <p>"email" => User's email</p>
  
  <p>"pw" => User's Password</p>
  
  <p>json response: session id on successful login</p>
  
  <p>Am trying like this.</p>
  
  <pre><code>NSMutableURLRequest *request;
  
  request=[NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"www.XXXXXXXX.com/api.php?task=login"]];
  
  
  [request setHTTPMethod:@"POST"];
  
  
  NSString *postString =@"email=xxxxxxxx@gmail.com&amp;pw=1234";
  
  [request setValue:[NSString
                     stringWithFormat:@"%d", [postString length]] forHTTPHeaderField:@"Content-length"];
  
  [request setHTTPBody:[postString
                        dataUsingEncoding:NSUTF8StringEncoding]];
  
  NSURLConnection *connection=[[NSURLConnection alloc] initWithRequest:request delegate:self];
  </code></pre>