【问题标题】:RestKit not sending POST paramsRestKit 不发送 POST 参数
【发布时间】:2012-11-23 10:37:39
【问题描述】:

我正在发送

[self.responseObjectManager.client post:@"" usingBlock:^(RKRequest * request){

    RKParams * params = [RKParams params];

    [params setValue:@"VALUE1" forParam:@"PARAM1"];

    request.params = params;

    request.onDidLoadResponse = ^(RKResponse *response){

        ALog(@"Loaded resp %@", response.bodyAsString);

    };

}];

index.php

header('Content-Type: application/json');

echo "WHAT IS ".$GLOBALS['HTTP_RAW_POST_DATA']." ANOTHER".@file_get_contents('php://input');
echo "POST ".var_dump($_POST)." GET ".var_dump($_GET); 

然后我就回来了

"Loaded resp POST  GET "

所以看起来帖子参数没有发送

【问题讨论】:

    标签: objective-c restkit


    【解决方案1】:

    问题出在

    [self.responseObjectManager.client post:@"" usingBlock:^(RKRequest * request){
    

    必须直接指定index.php

    [self.responseObjectManager.client post:@"/index.php" usingBlock:^(RKRequest * request){
    

    比响应在

    中可见
    $GLOBALS['HTTP_RAW_POST_DATA']
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-11-19
      • 1970-01-01
      • 1970-01-01
      • 2016-01-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-07
      相关资源
      最近更新 更多