【发布时间】:2017-06-05 10:28:28
【问题描述】:
我正在使用 guzzle 查询我的 API。
$client = new Client();
$response = $client->post('xxxxxx',
array(
'headers' => array('Content-Type'=>'application/json'),
'json'=> array(
"type" => 0,
[...]
)
)
);
//$response = json_decode($response);
dd($response->getBody());
这应该给我这样的输出:
{
"returnCode": 0,
"success": true
}
但我得到了别的东西。
Stream {#230 ▼
-stream: stream resource @12 ▼
wrapper_type: "PHP"
stream_type: "TEMP"
mode: "w+b"
unread_bytes: 0
seekable: true
uri: "php://temp"
options: []
}
-size: null
-seekable: true
-readable: true
-writable: true
-uri: "php://temp"
-customMetadata: []
}
谁能帮助我或告诉我我做错了什么?我想发送原始帖子数据并在之后获取原始帖子数据然后我想保存(例如在数据库中)。
【问题讨论】: