Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何使用curl登录服务器?_Ios_Objective C_Json_Curl_Afnetworking - Fatal编程技术网

Ios 如何使用curl登录服务器?

Ios 如何使用curl登录服务器?,ios,objective-c,json,curl,afnetworking,Ios,Objective C,Json,Curl,Afnetworking,我想与服务器通信 服务器需要以下信息: { "user": { "email": "user@example.com", "password": "secret", "password_confirmation": "secret", "seed_recipes": true //not obligatory files } } 这是卷曲: curl -d "user[email]=user@example.com" -d "user[

我想与服务器通信

服务器需要以下信息:

{
  "user": {
    "email": "user@example.com",
    "password": "secret",
    "password_confirmation": "secret",
    "seed_recipes": true          //not obligatory files
  }
}
这是卷曲:

curl -d "user[email]=user@example.com" -d "user[password]=password" -d "user[password_confirmation]=password" -d "user[seed_recipes]=true" http://domain.com/users
我在下面写到,服务器显示了这些错误

(
email =     (
        "can't be blank",
        "is invalid"
    );
    password =     (
        "can't be blank"
    );
这是我的代码:

NSDictionary *parameters = @{@"user[email]":email, @"user[password]":password, @"user[password_confirmation]":password_confirmation};

    [manager POST:@"http://domain.com/users" parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) {
看来我可能没有向服务器发送正确的消息。
有人知道如何矫正卷发吗?

非常感谢你的帮助,你能给我一个参考吗?我很难将不同的卷发图灵到JSON。我想学习和学习基地。非常感谢你的帮助,你能给我一个参考吗?我很难将不同的卷发图灵到JSON。我想学习和学习基地。非常感谢你的帮助,你能给我一个参考吗?我很难将不同的卷发图灵到JSON。我想学习和学习基地。非常感谢你的帮助,你能给我一个参考吗?我很难将不同的卷发图灵到JSON。我想从基地学习。
NSDictionary *parameters = @{@"user": @{@"email": email, @"password": password, @"password_confirmation": password_confirmation}};