cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Delete remote file

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 4 Jan 2002 16:15:55 +0100 (MET)

On Fri, 4 Jan 2002, raoul cridlig wrote:

> So, can I use CURLOPT_QUOTE with HTTP requests, when I'm using proxy ?
>
> Something like:
>
> char buf[BUF_LGTH] = "DELETE ";
> struct curl_slist *hl = NULL;
>
> strcat(buf, hostpath);
> hl = curl_slist_append(hl, buf);
> curl_easy_setopt(curl, CURLOPT_URL, hostURL);
>
> curl_easy_setopt(curl, CURLOPT_PROXY, Proxyname);
> curl_easy_setopt(curl, CURLOPT_PROXYPORT, port);
>
> curl_easy_setopt(curl, CURLOPT_QUOTE, hl);
> res = curl_easy_perform(curl);
> return res;
>
> Is it ok?

No, the CURLOPT_QUOTE is for FTP operations. You should instead use the
CURLOPT_CUSTOMREQUEST option to set a custom request:

 curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE");
 curl_easy_setopt(curl, CURLOPT_URL, "http://deleteme.com/remove");
 res = curl_easy_perform(curl);

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2002-01-04