Internal exception when using postUrl.

Internal exception when using postUrl.

Hi, we are triying to make a POST request using a custom function.
We have the url, encoded with encodeUrl() and a map with the header parameters (including the access token).
Our function takes some information about a lead as parameters. So, we have something like:
hdr=map();
hdr.put("key1","parameter1");
hdr.put("key2","parameter2");
url = " https://something.com";
url = encodeUrl(url);
response=postUrl(url,hdr);
text = response.get("responseText").toJSONList();
info text;
We
Error at line number: (the line where we try to get the response text)
Error due to - 'Internal Exception'

Any idea about what is happening?