The mixin Msf::Exploit::Remote::HttpClient already provides a method just like this one, so you can safely delete it.