Basic and extended solution (basic is commented out) for http collect