Skip to main content
Participant
December 15, 2009
Question

Trying to send a URL with a query string appended

  • December 15, 2009
  • 2 replies
  • 1514 views

Hi - I'm trying to use Cold Fusion to send information via query string. The company I am trying to send the info to gave me the URL below. I have created a variable call couponName and am trying to send it to them so that it looks like this: https://company.com/exec/coupon.tsb?couponName=whatever

My code is below. It does not work. If I type the info directly into the browser, substituting the actual coupon name for the variable couponName, it does work.


<cfhttp
method="Get"
url="https://company.com/exec/coupon.tsb">

<cfhttpparam name="couponName" value="#couponName#" type="url" />
</cfhttp>

    This topic has been closed for replies.

    2 replies

    Inspiring
    December 16, 2009

    Start by putting in some <cfoutput>/<cfdump> tags so that you can see, on your screen, exactly what this string actually looks like.  (You think you know, but there's really only one way to be sure:  try it, and eyeball the result.)  Once you know that the generated string is correctly-formed and represents a syntactically valid URL, then you can move on to further troubleshooting.  But don't overlook the obvious.

    ilssac
    Inspiring
    December 15, 2009

    Have you imported the SSL certificate in the Java key store so that ColdFusion can talk to this secure site.

    That is often necessary when working with HTTPS and the <cfhttp....> tag.

    How to import certificates into certificate stores (ColdFusion)

    http://kb2.adobe.com/cps/400/kb400977.html

    Participant
    December 15, 2009

    Thanks.  I'll read the article and take a look at that.

    Does the Code look correct though?  I'm trying to narrow down what could be the issues and want to make sure it isn't something as simple as the code not being right.

    ilssac
    Inspiring
    December 15, 2009

    It looks fine.  If you care to try this for works just as well.

    <cfhttp
    method="Get"
    url="https://company.com/exec/coupon.tsb?couponName=whatever" />

    But your first form, with the <cfhttparam...> tag is more programmable.