title: How to access secured url from ios
body: <p>I'm trying to access a secure url from ios. Basically url will prompt the user with Username and Password. How can I send username and Password from ios?</p>
  
  <p><strong>My Code</strong>
  Here is the Methods that I'm using to access JSON Parser</p>
  
  <pre><code>- (NSString *)stringWithUrl:(NSURL *)url{
  NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url
                                              cachePolicy:NSURLRequestReturnCacheDataElseLoad
                                          timeoutInterval:30];
  // Fetch the JSON response
  NSData *urlData;
  NSURLResponse *response;
  NSError *error;
  
  // Make synchronous request
  urlData = [NSURLConnection sendSynchronousRequest:urlRequest
                                  returningResponse:&amp;response
                                              error:&amp;error];
  
  // Construct a String around the Data from the response
  return [[[NSString alloc] initWithData:urlData encoding:NSUTF8StringEncoding] autorelease];}
  
  
  - (id) objectWithUrl:(NSURL *)url{
  SBJsonParser *jsonParser = [[[SBJsonParser alloc]init] autorelease];
  NSString *jsonString = [self stringWithUrl:url];
  
  // Parse the JSON into an Object
  return [jsonParser objectWithString:jsonString error:nil]; }
  </code></pre>
  
  <p>Here is the piece of code that I'm retrieving json keys to my dictionary.</p>
  
  <pre><code>- (NSDictionary *) downloadFeed {
  id response = [self objectWithUrl:[NSURL URLWithString:@"http://mysite.com/Services/Secure.svc/GetList?id=2127"]];
  
  NSDictionary *feed = (NSDictionary *)response;
  return feed; }
  </code></pre>
  
  <p>Can someone let me know where can I pass the Username and Password to this url?</p>