consolidate the curl option setting code