• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSURL question with user name and pwd in the URL..
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSURL question with user name and pwd in the URL..


  • Subject: NSURL question with user name and pwd in the URL..
  • From: Charles Bennett <email@hidden>
  • Date: Fri, 13 Sep 2002 16:43:37 -0400

Hi all, I just can't seem to get this to work.
and I'm wondering if anyone has tried it under 10.2

I'm just trying to include the user name and pass word in the URL so I can download a protected url without user interaction. I cannot unprotect the url..


assuming that usr and pwd are stand in's for the real user name and pass word.

NSURL *theUrl;
NSData *urlData;

I tried

theUrl = [NSURL URLWithString:@"http://usr:email@hidden.0.1/index.html";];

and (taken from an example found in the archives at mamasam)

theUrl = [NSURL URLWithString:@"http://usr:pwd/192.168.0.1/index.html";];

In either case, asking for the data

urlData = [theUrl resourceDataUsingCache:FALSE];

always returns nil


Any pointers, example or pointers to the correct documentation would
be welcome.

I know that the url I'm trying to reference works, if I try to browse to
it, I get the usual login dialog box. I have verified the password and name are correct.

I searched mamasam and the tech docs at Apple, but didn't find any examples at Apple.

Thanks,

Chuck


--
UPS Management software for OS X
http://www.powerguardian.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: NSURL question with user name and pwd in the URL..
      • From: Dan Wood <email@hidden>
References: 
 >Re: setFrameUsingName , setFrameAutosaveName (From: Andreas Mayer <email@hidden>)

  • Prev by Date: Getting paper margins before printing
  • Next by Date: Re: Scope of [NSMutableDictionary setObject:] in an array
  • Previous by thread: Re: setFrameUsingName , setFrameAutosaveName
  • Next by thread: Re: NSURL question with user name and pwd in the URL..
  • Index(es):
    • Date
    • Thread