Objective-c HTTP Basic authentication

后端 未结 3 1911
青春惊慌失措
青春惊慌失措 2021-02-06 09:29

How would i go about replicating this in objective-c

curl -u rick@email.com:mypassword http://foo.lighthouseapp.com/projects.xml

I\'ve been pla

3条回答
  •  花落未央
    2021-02-06 09:51

    If you are using ASIHTTPRequest, this is all that is needed:

     request.shouldPresentCredentialsBeforeChallenge = YES;
     [request addBasicAuthenticationHeaderWithUsername:@"USER" andPassword:@"PASSWORD"];
    

提交回复
热议问题