Hello Everyone.. Has anyone used cfhttp to make a ...
# lucee
c
Hello Everyone.. Has anyone used cfhttp to make a request to a URL containing a colon in the path? No matter what configuration I use, the response is always a 404. The same parameters when used with CURL or Postman return the expected response. I suspect Lucee is using the colon as port number delimiter? Is there a way to make requests to this URL with cfhttp? Below is the code I'm using (api key redacted)
Copy code
body = {"contents": [{"parts": [{"text": "Tell me a joke"}]}]};
req = new http(
	url = "<https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent?key=foo>",
	method = "POST"
);
req.addParam(type = "header", name = "Content-Type", value = "application/json");
req.addParam(type = "body", value = SerializeJSON(body));

result = req.send().getPrefix();
dump(result);