revise curl code