Fix wrong Host HTTP header, when nonstandard ports are used

A new function which uses the URL instead of a host string has been added to the HttpRequestHelper
class. It uses the port from the URL and appends it if it is set in the URL, which means it is not a
standrd port, or is explicitly requested to be set.