我有問題。我發送到服務器POST
請求程序(xcode,我開發目標C),數據發送,但我需要在網站上註冊(身份驗證),我不知道,我怎麼發送這個字符串發送數據到網站
NSString * param = [NSString stringWithFormat:@"action=login&name=%@&password=%@", myName, myPassword]
我的代碼完全:
request.HTTPMethod = @"POST";
NSString * myName = _loginLogin.text;
NSString * myPassword= _passwordLogin.text;
NSString * param = [NSString stringWithFormat:@"action=login&name=%@&password=%@", myName, myPassword];
request.HTTPBody = [param dataUsingEncoding:NSUTF8StringEncoding];
NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
我這個* (www.dnevnik.ru)工作 *頁。
和我的網站字符串NSString *postString = [NSString stringWithFormat:@"&username=%@&password=%@", username, password];
不適合?
您需要解析委託回調NSURLConnectionDelegate響應 – Tim