MULE-8018: Merge http connector code cleanup

It is used while building the request. But will refactor that code so that this method is not required anymore.