reconstructure curl code