Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $username = 'pfr3$tuser7';
- $password = 'hGcv%^*4534c8*-r45';
- $url = "https://staging.partsvoice.com/rest/partsfilllocate";
- $xml_data ='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
- <partLocate>
- <automakerID>FO</automakerID>
- <partNumber>2L5Z-7D100-BA</partNumber>
- <postalCode>78701</postalCode>
- <quantity>3</quantity>
- </partLocate>';
- $ch = curl_init($url);
- curl_setopt($ch, CURLOPT_MUTE, 1);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_HTTPHEADER, array(
- 'Content-Type: text/xml',
- 'Authorization: Basic ' . base64_encode($username . ':' . $password),
- )
- );
- curl_setopt($ch, CURLOPT_POSTFIELDS, "$xml_data");
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- $output = curl_exec($ch);
- curl_close($ch);
- header('Content-type: text/xml');
- echo $output;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement