mirror of
https://github.com/adamdruppe/arsd.git
synced 2025-04-28 06:09:59 +03:00
catching up on lots of changes.
This commit is contained in:
parent
ca50fc2016
commit
5b816cb7e7
13 changed files with 1325 additions and 621 deletions
9
curl.d
9
curl.d
|
@ -106,7 +106,7 @@ string curlAuth(string url, string data = null, string username = null, string p
|
|||
|
||||
int res;
|
||||
|
||||
//curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
|
||||
// curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
|
||||
|
||||
res = curl_easy_setopt(curl, CURLOPT_URL, std.string.toStringz(url));
|
||||
if(res != 0) throw new CurlException(res);
|
||||
|
@ -122,6 +122,7 @@ string curlAuth(string url, string data = null, string username = null, string p
|
|||
curl_slist* headers = null;
|
||||
//if(data !is null)
|
||||
// contentType = "";
|
||||
if(contentType.length)
|
||||
headers = curl_slist_append(headers, toStringz("Content-Type: " ~ contentType));
|
||||
|
||||
foreach(h; customHeaders) {
|
||||
|
@ -157,8 +158,10 @@ string curlAuth(string url, string data = null, string username = null, string p
|
|||
//res = curl_easy_setopt(curl, 81, 0); // FIXME verify host
|
||||
//if(res != 0) throw new CurlException(res);
|
||||
|
||||
res = curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
|
||||
if(res != 0) throw new CurlException(res);
|
||||
version(no_curl_follow) {} else {
|
||||
res = curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
|
||||
if(res != 0) throw new CurlException(res);
|
||||
}
|
||||
|
||||
if(methodOverride !is null) {
|
||||
switch(methodOverride) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue