(bind-func curl_request_with_auth
(let ((handle:CURL null)
(cdat:curl_dat* (zalloc)))
(lambda (url:i8* dat:i8* user:i8* password:i8*)
;; init data structures
(set! handle (curl_easy_init))
(tset! cdat 0 dat)
(tset! cdat 1 0)
(curl_easy_setopt handle CURLOPT_URL url)
(curl_setopts_basic handle cdat)
(curl_setopts_authenticate handle user password)
(curl_perform_request handle cdat))))