Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $url = "http://192.168.20.9:8060/api/";
- $post_string = '
- <?xml version="1.0" encoding="UTF-8" ?>
- <LoyaltyCardPersonalizeRequest>
- <CardCode>3592018089698</CardCode>
- <ClientName>Antoan Videnov</ClientName>
- <ClientAddress>София</ClientAddress>
- <ClientPhone>0886777074</ClientPhone>
- <ClientEMail>a_videnov@subra.bg</ClientEMail>
- </LoyaltyCardPersonalizeRequest>';
- $header = "POST HTTP/1.0 \r\n";
- $header .= "Content-type: text/xml \r\n";
- $header .= "Content-length: ".strlen($post_string)." \r\n";
- $header .= "Content-transfer-encoding: text \r\n";
- $header .= "Connection: close \r\n\r\n";
- $header .= $post_string;
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
- curl_setopt($ch, CURLOPT_URL,$url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_TIMEOUT, 4);
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $header);
- $data = curl_exec($ch);
- if(curl_errno($ch))
- print curl_error($ch);
- else
- curl_close($ch);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement