Jump to content

Posting XML data


jburcher

Recommended Posts

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.com/ups.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);
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.