(bind-func curl_request_with_header
(let ((handle:CURL null)
(cdat:curl_dat* (zalloc)))
(lambda (url:i8* dat:i8* header: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)
(let ((header_slist (curl_setopts_header handle header)))
(curl_perform_request handle cdat)
(curl_slist_free_all header_slist))
cdat)))