i retrieving data via nsurlrequest , working perfectly. have added password protection directory , not sure how configure code add in password directory (mystuff)
can tell me how done based on current code?
thank you
-(void) retrieve { nsurlrequest *therequest=[nsurlrequest requestwithurl:[nsurl urlwithstring:@"http://xxxxxxx.com/mystuff/test.php"]cachepolicy:nsurlrequestuseprotocolcachepolicy timeoutinterval:8.0]; nsurlconnection *theconnection=[[nsurlconnection alloc] initwithrequest:therequest delegate:self]; if (theconnection) { receiveddata = [[nsmutabledata data] retain]; } else { // inform user connection failed. [self showserveralert]; return; } } //call other delegate methods
the standard url syntax be:
http://username:password@xxxxx.com/mystuff/test.php when doing though should not use http. want use https. , don't hardcode password in code. hacker figure out.
Comments
Post a Comment