开发者

How to login and stay logged in using Basic Authentication for Iphone app into a rails server?

I am using ASIHTTP library to send the requests.I send the login in synchronously and then all other requests Asynchronously. My Login seems to work as does the GET method. 开发者_StackOverflow中文版BUT, my Post method does not work. it returns a Error Domain=ASIHTTPRequestErrorDomain Code=3 "Authentication needed". I created the rails server using scaffolding and then added in Devise framework. I have absolutely no clue why the GET method works fine but my post method doesnt.

If i do this in a browser however, it works fine. Can someone please help me out? I can give you all the code you need.


request = [ASIHTTPRequest requestWithURL:url];    
[request setUseKeychainPersistence:YES];
[request setUsername:kHTTP_BASIC_AUTHORISE_USERNAME];
[request setPassword:kHTTP_BASIC_AUTHORISE_PASSWORD];   
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜