I have that code
func SendRequest(request: String) -> String
{
var response = \"\"
var (success, errmsg) = client.connect(timeout: 1)
if succe
Some possibilities to examine include whether or not data actually contains any bytes, and whether or not it's actually a valid UTF-8 string. Assuming this is an http request/response that you're handling, check the Content-type, in particular the charset property. If the data's encoded as something other than text , or it's not UTF-8 format, it won't convert to a string.