Php/curl/xml送信
提供: 初心者エンジニアの簡易メモ
$xmltag = <<< EOD <?xml version="1.0" encoding="UTF-8"?> <root><id>2</id><name>taro</name></root> EOD; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml')); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $xmltag); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($ch); curl_close($ch);