diff --git a/includes/HttpClientCurlDelegate.inc b/includes/HttpClientCurlDelegate.inc
index b87f6b6..226fc59 100644
--- a/includes/HttpClientCurlDelegate.inc
+++ b/includes/HttpClientCurlDelegate.inc
@@ -43,14 +43,15 @@ class HttpClientCurlDelegate extends HttpClientDelegate {
 
     curl_setopt($ch, CURLOPT_USERAGENT, 'Drupal (+http://drupal.org/)');
 
-    curl_setopt_array($ch, $curlopts);
-
     curl_setopt($ch, CURLOPT_HEADER, 1);
     curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $request->method);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($ch, CURLOPT_URL, $request->url());
     curl_setopt($ch, CURLOPT_POSTFIELDS, $request->data);
     curl_setopt($ch, CURLOPT_HTTPHEADER, $request->getHeaders());
+
+    curl_setopt_array($ch, $curlopts);
+
     return $ch;
   }
 }
