0
我试图在PHP中发送POST请求,但帖子字段在URL中。上述如何使用php在HTTP POST请求中发送参数?
$project_no = 1711;
$group_name = "name of group";
$url = urlencode("http://api.example.org/v1/projects?auth_token=xsxxex-xxmczx-66mvmc-9133&project_no=" . $project_no . "&group_name=" . $group_name);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
var_dump($response)
代码返回,说
bool(false)
一个错误我在做什么错在这里?
我得到了一个错误说“{”消息“: “找不到与请求URI'http://api.example.org/p/v1/projects'匹配的HTTP资源。”}“ – Tsea