REST API Problem

I have a C++ client that makes use of the REST API by the curl library.

99% of the time I use GET or SET (using the ID such as sun.sun) it works fine. I can retrieve data, I can switch on and off devices.

That remaining 1% fails with curl error 7 i.e. CURLE_COULDNT_CONNECT

Any ideas as to the root cause ? should I try the request again ?

Regards,
Andrew