Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CFHTTP problem

Contributor ,
Sep 30, 2008 Sep 30, 2008
Evening all,

I have apage that uses cfhttp to post data to a fulfillment script on another site. The other site has recently upgraded their server O/S and the http post is no longer being received by them.

We have successfully tested sending form data via a standard form post using an enctype of application/x-www-form-urlencoded. If we do a standard form post using an enctype of multipart/form-data they do not receive the post, so I am assuming we need to use application/x-www-form-urlencoded.

How would I emulate this in cfhttp? I understand that we need to post an http header. Is this what the an enctype of application/x-www-form-urlencoded would do for me?

Thanks in advance.

Paul
1.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 30, 2008 Sep 30, 2008
Can you pls post your code.

--
Adam
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 30, 2008 Sep 30, 2008
Adam,

My code is below. I tried tacking on an output of the cfhttp.FileContent and it returns the result as an error (Bad Request (Invalid Hostname)). This should not be the case as when I post the data directly the page in the URL below, it works just fine.

I just read the link you posted and if I understand correctly CF will automatically use application/x-www-form-urlencoded unless the form data contains file data? If this is the case, my form just contains text data from the formfields and so should submit correclty, but it does not.

Paul
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 30, 2008 Sep 30, 2008
> (Bad Request (Invalid Hostname)).

That generally means the server at the other end accepts the domain name
you're using, but the web server is not configured for it.

Are you *dead sure* that when you do this via a form, the URL you're
posting to is *exactly* the same? And that the *exact* same code used to
work before the third party did the OS upgrade?

Have you got in touch with the bods who administer the server at the other
end, and told them about this, and ask if they have any idea?

--
Adam
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 30, 2008 Sep 30, 2008
Thanks Adam,

Yes, the url is identical as are the form values.

The other end are implying it is a problem at our end. As far as they are concerned, a form posting directly to the script page works fine. Having said that, the cfhttp should be identical to standard form post should it not?

Thanks,
Paul
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 30, 2008 Sep 30, 2008
Oh, and did you read the docs vis-a-vis CFHTTP &
application/x-www-form-urlencoded?

http://livedocs.adobe.com/coldfusion/8/Tags_g-h_09.html

--
Adam
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Sep 30, 2008 Sep 30, 2008
Is there by chance an entry in the hosts file on the server for this hostname you're trying to post to? Maybe they changed the IP address in the process of their upgrades...

If you try to post to that URL when you're on the server, does it work?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 30, 2008 Sep 30, 2008
Kronin555,

I have no access to the server and the other company are adamant that the problem is at our end.

If they changed the IP address in the process of their upgrades, then surely the form submitting to the same URL would also have the same problems would it not?

It is so strange - cfhttp post is just not getting to them, and returns an invalid hostname error.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Sep 30, 2008 Sep 30, 2008
I'm talking about your CF server. The one doing the <cfhttp>. Are you sure that server (the one running Coldfusion, doing the cfhttp) is posting to the correct IP address?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 30, 2008 Sep 30, 2008
The server is doing the post as far as I can tell - but to the URL, not an IP.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Sep 30, 2008 Sep 30, 2008
LATEST
I'm not making myself clear.

When you do a cfhttp in coldfusion, to a domain, the server goes through the process if looking up an IP address to match to that domain name. If there's an entry, on the CF server, for that domain name in the hosts file, and it's giving the wrong IP address, that could be the problem.

Or, if the DNS server that the CF server is setup to talk to is caching a bad IP address.

Basically, I'm asking, are you sure that, on the CF server, that domain (that you're cfhttp'ing to) is mapping to the right IP address?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources