dav/methods.c

changeset 29
938957a4eea7
parent 27
e584c351b402
--- a/dav/methods.c	Thu Aug 22 11:25:16 2013 +0200
+++ b/dav/methods.c	Thu Aug 22 12:45:12 2013 +0200
@@ -500,3 +500,19 @@
     CURLcode ret = curl_easy_perform(handle);
     return ret;
 }
+
+
+CURLcode do_head_request(CURL *handle) {
+    curl_easy_setopt(handle, CURLOPT_CUSTOMREQUEST, "HEAD");
+    curl_easy_setopt(handle, CURLOPT_PUT, 0L);  
+    curl_easy_setopt(handle, CURLOPT_UPLOAD, 0L);
+    curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, 0);
+    curl_easy_setopt(handle, CURLOPT_NOBODY, 1L);
+    
+    curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, dummy_write);
+    curl_easy_setopt(handle, CURLOPT_WRITEDATA, NULL);
+    
+    CURLcode ret = curl_easy_perform(handle);
+    curl_easy_setopt(handle, CURLOPT_NOBODY, 0L);
+    return ret;
+}

mercurial