Http send function inspired by express