REST API を使用して QC で新しい欠陥を開こうとしています
私のコードは以下のようになります
createxml ='<Entity Type="defect">
<Fields>
<Field Name="user-15">
<Value>Development</Value>
</Field>' ;
$qc = curl_init();
// create a cookie file
$ckfile = tempnam ("/tmp", "CURLCOOKIE");
// The authentication is done and also checks are done and after below code is executed to create a new defect in QC
$url ="http://host/qcbin/rest/domains/STANDARD_STRUCT/projects/Releases/defects/" ;
curl_setopt($qc, CURLOPT_COOKIEFILE, $ckfile);
curl_setopt($qc, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml"));
curl_setopt($qc, CURLOPT_HTTPHEADER, Array("Accept: application/xml"));
curl_setopt($qc, CURLOPT_URL, $url);
curl_setopt($qc, CURLOPT_POST, 1);
curl_setopt($qc, CURLOPT_POSTFIELDS,$createxml);
curl_setopt($qc, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($qc);
if(curl_errno($qc))
print curl_error($qc) ;
else
curl_close($qc) ;
echo $result ; `
注意: 未定義の定数 http_code の使用 - C:\xampp\htdocs\createdef.php の 150 200 行目の 'http_code' を想定 応答が作成されない `
問題の原因がわかりません。