Jump to content


Photo

Posting XML data


  • Please log in to reply
1 reply to this topic

#1 jburcher

jburcher
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 30 September 2006 - 12:38 AM

I am attempting to post to UPS for shipping rate quotes for a shopping cart program. They require xml via an http post. I am using curl, see below. I am getting nothing back as a response. Does anyone know if I am going about this the wrong way or have I just screwed up the syntax or something? Thanks - Jeff

--------------------------------------------------

$ch = curl_init("https://wwwcie.ups.c...s.app/xml/Rate"); // URL of gateway for cURL to post to
curl_setopt($ch, CURLOPT_HEADER, 0); // set to 0 to eliminate header info from response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // Returns response data instead of TRUE(1)
curl_setopt($ch, CURLOPT_POSTFIELDS, stripslashes($ups_values)); // use HTTP POST to send form data
$resp = curl_exec($ch); //execute post and get results
curl_close ($ch);

$ups_resp = str_replace("\"", "'",$resp);


#2 Gaoshan

Gaoshan
  • Members
  • PipPip
  • Member
  • 25 posts

Posted 30 September 2006 - 06:14 AM

looks like: "Failed to connect to 72.246.73.242: Host is down"

To see this yourself try adding:
if (curl_errno($ch)) {
   print curl_error($ch);
} else {
   curl_close($ch);
}





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users