Connection Failure

  • 1
  • Question
  • Updated 3 years ago
I am using the following url:

http://api.wunderground.com/api//hist...

When I try it in the browser it works. When I try it using your coldfusion example code:

Current temperature in #location# is #temp_f#

I get an error:

JSON parsing failure at character 1:'C' in Connection Failure

Basically, it is returning connection failure rather than the json code
Photo of Grant Mckay

Grant Mckay

  • 2 Posts
  • 0 Reply Likes

Posted 6 years ago

  • 1
Photo of Grant Mckay

Grant Mckay

  • 2 Posts
  • 0 Reply Likes
I added the following code in between the cfhttp tags:

And, that fixed this problem.

I found this fix here:
http://australiansearchengine.wordpre...
Photo of Jeff Thompson

Jeff Thompson

  • 3 Posts
  • 0 Reply Likes
If you're still having problems change the value of the "accept-encoding" header from deflate to *

I found the info here:
http://stackoverflow.com/questions/81...
Photo of Bobby Z

Bobby Z

  • 3 Posts
  • 0 Reply Likes
Hi,

I'm still getting the "JSON parsing failure at character 1:'C' in Connection Failure" error after adding the following 2 cfhttpparam tags to the request.

<cfhttpparam type="header" name="Accept-Encoding" value="*">
<cfhttpparam type="header" name="TE" value="deflate;q=0">

Any other suggestions?

By the way, I'm going a POST and not a GET.

Many thanks in advance.
Photo of Jeff Thompson

Jeff Thompson

  • 3 Posts
  • 0 Reply Likes
Bobby,
Could you post the full url you are using. I just tried a couple variations, with and without the params, and it's working for me.
Jeff
Photo of Bobby Z

Bobby Z

  • 3 Posts
  • 0 Reply Likes
Hi Jeff,

Can we do this via our personal email conversation from this point on?

Thanks,

Bobby
Photo of Jeff Thompson

Jeff Thompson

  • 3 Posts
  • 0 Reply Likes
Sure, but I don't see a way to send private messages with this forum.
Photo of Bobby Z

Bobby Z

  • 3 Posts
  • 0 Reply Likes
My email is bobbyz0918@gmail.com. Can you send me an email from yahoo mail or gmail so I can reply and take it from there?

Thanks.