object to handler curl request in php