Cfhttp / network connection failure

Hi,

lucee docker image v52 on Ubuntu 18.04.

<cfhttp url="http://192.168.56.100:4000/user" method="post" result="getToken" timeout="90">
  <cfhttpparam type="header" name='content-type'
value='application/x-www-form-urlencoded'>
  <cfhttpparam type="formfield" name="username" value="Don">
  <cfhttpparam type="formfield" name="company" value="XYZ">
</cfhttp>

Syntax Error, invalid Expression [Connection Failure]
replacing the IP address with localhost resulted in the same error.

curl works fine.

It seems networking configuration may not be right? What to determine and how to fix it? Thanks.

not sure if this is your issue,

I had something similar happen to me. used postman to compare requests and the header was different from curl. api was expecting it formated like curl does it and no way to get the same with cfhttp.

ended up using cfexecure to call curl.

but normally cfhttp works fine.

Yeah, oddly some times <cfexecute … /> works better, but in this case, while it didn’t generate any error, but still failed to connect even via curl call.

Not sure why the exact same lucee docker image on two identical ubuntu virtual machines would behave differently.

Maybe try removing the port from the URL and add the port parameter.

cfhttp url=“http://192.168.56.100/user” method=“post” port=“4000”

Jay, I appreciate your input, but that won’t work, but the api server is running at port 4000.

The good news is that I have another vm box to “play” with.
The bad news is I’m under the impression my Internet connection is frequently hacked/harrassed by some bad network security person but I could be wrong and I hope I’m wrong otherwise it would be hell