Skip to:
When I run this code to check my elasticsearch version<cfhttp url="http://localhost" method="get" charset="utf-8" timeout="5" result="stResponse" port="9200"> <cfhttpparam type="header" name="Content-Type" value="application/json; charset=utf-8" /></cfhttp>it will ignore the port 9200 and get my webroot directory listing instead of the elasticsearch json information.Only appending the port to the url works:<cfhttp url="http://localhost:9200" method="get" charset="utf-8" timeout="5" result="stResponse"> <cfhttpparam type="header" name="Content-Type" value="application/json; charset=utf-8" /></cfhttp>
When I run this code to check my elasticsearch version
<cfhttp url="http://localhost"
method="get"
charset="utf-8"
timeout="5"
result="stResponse"
port="9200">
<cfhttpparam type="header" name="Content-Type" value="application/json; charset=utf-8" />
</cfhttp>
it will ignore the port 9200 and get my webroot directory listing instead of the elasticsearch json information.
Only appending the port to the url works:
<cfhttp url="http://localhost:9200"
method="get"
charset="utf-8"
timeout="5"
result="stResponse">
<cfhttpparam type="header" name="Content-Type" value="application/json; charset=utf-8" />
</cfhttp>