|
|
|
#1
|
|||
|
|||
|
Here is a simple script to post XML through curl
HTTP POST <?php $xml_data ='<Req1>'. '<Agency>'. '<Iata>34567</Iata>'. '<Agent>thegetpr</Agent>'. '<P***word>myp***word</P***word>'. '<Brand>google.com</Brand>'. '</Agency>'; $URL = "https://www.yoursitename.com/path/"; $ch = curl_init($URL); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml')); curl_setopt($ch, CURLOPT_POSTFIELDS, "$xml_data"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch); curl_close($ch); ?> Last edited by ravi72194; 24-09-2009 at 04:08 PM. |
![]() |
| Bookmarks |
| Tags |
| curl, http, post, xml |
| Thread Tools | |
| Display Modes | |
|
|