cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl-library Digest, Vol 87, Issue 10

From: huancong deng <denghuancong_at_gmail.com>
Date: Wed, 7 Nov 2012 16:51:54 +0800

thans a lot ~~~ i love you so much ~~~ thanks.

On Wed, Nov 7, 2012 at 4:34 PM, <curl-library-request_at_cool.haxx.se> wrote:

> Send curl-library mailing list submissions to
> curl-library_at_cool.haxx.se
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-library
> or, via email, send a message with subject or body 'help' to
> curl-library-request_at_cool.haxx.se
>
> You can reach the person managing the list at
> curl-library-owner_at_cool.haxx.se
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of curl-library digest..."
>
>
> Today's Topics:
>
> 1. Using http DELETE how to add param (huancong deng)
> 2. Re: Using http DELETE how to add param (Nick Zitzmann)
> 3. Http Delete request return 400 (huancong deng)
> 4. Re: Http Delete request return 400 (Michael Wood)
> 5. error when send email via curl (??)
> 6. Does libcurl support anonymous ftp server? (???)
> 7. use libcurl to send http delete request (huancong deng)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 7 Nov 2012 11:55:19 +0800
> From: huancong deng <denghuancong_at_gmail.com>
> To: curl-library_at_cool.haxx.se
> Subject: Using http DELETE how to add param
> Message-ID:
> <
> CAJ2q7siKw9HwTAUg+NQQcU690ys03_BHBreo75SmCSN4+s5POw_at_mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> how can i use libcurl to sent a http delete rquest?
> how can i add some to the http delete request??
>
>
>
> *Any help will be appreciated. Thanks in advance. *
> *:)*
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://cool.haxx.se/pipermail/curl-library/attachments/20121107/56d11c98/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 2
> Date: Tue, 6 Nov 2012 21:33:35 -0700
> From: Nick Zitzmann <nick_at_chronosnet.com>
> To: libcurl development <curl-library_at_cool.haxx.se>
> Subject: Re: Using http DELETE how to add param
> Message-ID: <235CAE38-3B18-47D8-BC7E-F45BA168F24C_at_chronosnet.com>
> Content-Type: text/plain; charset=us-ascii
>
>
> On Nov 6, 2012, at 8:55 PM, huancong deng <denghuancong_at_gmail.com> wrote:
>
> > how can i use libcurl to sent a http delete request?
>
> Set CURLOPT_CUSTOMREQUEST to "DELETE" in your easy handle.
>
> > how can i add some to the http delete request??
>
> What are you trying to accomplish?
>
> Nick Zitzmann
> <http://www.chronosnet.com/>
>
>
>
>
>
> ------------------------------
>
> Message: 3
> Date: Wed, 7 Nov 2012 14:59:30 +0800
> From: huancong deng <denghuancong_at_gmail.com>
> To: curl-library_at_cool.haxx.se
> Subject: Http Delete request return 400
> Message-ID:
> <CAJ2q7shXh5+jGSG7d5Na2DzFogeRuN-OHG-fPg=
> g7Snn-oWsVg_at_mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> 82 curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
> 83 curl_easy_setopt(curl,CURLOPT_CUSTOMREQUEST,"delete");
> 84 curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION,&http_callback);
> 85 curl_easy_setopt(curl, CURLOPT_URL,"
> http://ucenter.local.ucloud.cn/api/aiotest/test");
> 86
>
> //curl_easy_setopt(curl,CURLOPT_POSTFIELDS,"username=huancong&password=doyou");
> 87 res = curl_easy_perform(curl);
> the server return :
> <html>
> <head><title>400 Bad Request</title></head>
> <body bgcolor="white">
> <center><h1>400 Bad Request</h1></center>
> <hr><center>nginx/1.2.4</center>
> </body>
> </html>
> ==================================================================
> but, when i use curl command in centos,it return well.
> [ucdn_at_u201 test]$ curl -X DELETE
> http://ucenter.local.ucloud.cn/api/aiotest/test
> <?xml version="1.0" encoding="utf-8"?>
> <xml><feedback>hi, delete
>
> response.</feedback><api_params><username></username><password></password></api_params></xml>
> [ucdn_at_u201 test]$
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://cool.haxx.se/pipermail/curl-library/attachments/20121107/f509772d/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 4
> Date: Wed, 7 Nov 2012 09:13:44 +0200
> From: Michael Wood <esiotrot_at_gmail.com>
> To: libcurl development <curl-library_at_cool.haxx.se>
> Subject: Re: Http Delete request return 400
> Message-ID:
> <
> CAP6d-HXHqq-1bUXUbk8aWWB-134kcME8C0RMkxjqKxCgb6UM7A_at_mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On 7 November 2012 08:59, huancong deng <denghuancong_at_gmail.com> wrote:
> >
> > 82 curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
> > 83 curl_easy_setopt(curl,CURLOPT_CUSTOMREQUEST,"delete");
>
> Use "DELETE" and not "delete".
>
> --
> Michael Wood <esiotrot_at_gmail.com>
>
>
> ------------------------------
>
> Message: 5
> Date: Wed, 7 Nov 2012 12:15:22 +0800 (CST)
> From: ?? <wang37921_at_163.com>
> To: curl-library_at_cool.haxx.se
> Subject: error when send email via curl
> Message-ID: <33332a05.5c29.13ad9146170.Coremail.wang37921_at_163.com>
> Content-Type: text/plain; charset="gbk"
>
> hello:
> when i send email through gmail is ok, but through mail.live failed.
> gmail:
> curl -n --ssl-reqd --mail-from "wang37921_at_gmail.com" --mail-rcpt "
> wang37921_at_live.com" --url smtp://smtp.gmail.com:465 -u wang37921_at_gmail.com-v --cacert cacert.pem
> it works.
> but send through live.mail, there has some errors.
> curl -n --ssl-reqd --mail-from "wang37921_at_live.com" --mail-rcpt "
> wang37921_at_gmail.com" --url smtp://smtp.live.com:587 -u wang37921_at_live.com-v --cacert cacert.pem
> verbose:
> * About to connect() to smtp.live.com port 587 (#0)
> * Trying 65.55.96.11...
> * connected
> * Connected to smtp.live.com (65.55.96.11) port 587 (#0)
> * successfully set certificate verify locations:
> * CAfile: cacert.pem
> CApath: none
> * SSLv3, TLS handshake, Client hello (1):
> * error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
> > QUIT
> < 0-SMTP410.blu0.hotmail.com Microsoft ESMTP MAIL Service, Version:
> 6.0.3790.467
> 5 ready at Tue, 6 Nov 2012 20:04:52 -0800
> < 530 5.7.0 Must issue a STARTTLS command first
> * Closing connection #0
> curl: (35) error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown
> protocol
>
> features:
> curl 7.28.0 (i386-pc-win32) libcurl/7.28.0 OpenSSL/1.0.1c WinIDN
> Protocols: dict file ftp ftps gopher http https imap imaps ldap pop3 pop3s
> rtsp
> smtp smtps telnet tftp
> Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM SPNEGO SSL SSPI
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://cool.haxx.se/pipermail/curl-library/attachments/20121107/ca74229e/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 6
> Date: Wed, 7 Nov 2012 14:01:37 +0800 (CST)
> From: ??? <chenshuhua515_at_163.com>
> To: curl-library_at_cool.haxx.se
> Subject: Does libcurl support anonymous ftp server?
> Message-ID: <37f15cc7.80d0.13ad975a81a.Coremail.chenshuhua515_at_163.com>
> Content-Type: text/plain; charset="gbk"
>
> I'm using libcurl to download and upload files from Linux ftp server. Now
> the server supports anonymous users. However when I tried to upload a file
> to it, I always get the same error code 25 and error message Failed FTP
> upload: 553. I even tried the command curl and got the same error code.
> Could you please tell me how to fix it? Or it's a limitation now?
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://cool.haxx.se/pipermail/curl-library/attachments/20121107/ff79019c/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 7
> Date: Wed, 7 Nov 2012 16:33:58 +0800
> From: huancong deng <denghuancong_at_gmail.com>
> To: curl-library_at_cool.haxx.se
> Subject: use libcurl to send http delete request
> Message-ID:
> <CAJ2q7sjg5YPhryw-6odsv_CNuSSo=
> h59M6ajYP-LGuhw1Szcrw_at_mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> #include <stdio.h>
> #include <curl/curl.h>
> #include <sys/stat.h>
> #include <fcntl.h>
> #include <string>
> #include <iostream>
> using namespace std;
> string g_buf = "";
> size_t http_callback(void *buffer, size_t size, size_t count, void *user_p)
> {
> g_buf += (char*)buffer;
> return size*count;
> }
>
> int main(void)
> {
> CURL *curl;
> CURLcode res;
> struct stat file_info;
> double speed_upload, total_time;
> FILE *fd;
>
> curl = curl_easy_init();
> if(curl) {
> curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
> curl_easy_setopt(curl,CURLOPT_CUSTOMREQUEST,"delete");
> curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION,&http_callback);
> curl_easy_setopt(curl,
> CURLOPT_URL,"http://ucenter.local.ucloud.cn/api/aiotest/test");
>
> curl_easy_setopt(curl,CURLOPT_POSTFIELDS,"username=huancong&password=doyou");
> res = curl_easy_perform(curl);
> if(res != CURLE_OK) {
> fprintf(stderr, "curl_easy_perform() failed: %s\n",
> curl_easy_strerror(res));
>
> }
> else {
> cout<<"receive data:"<<endl<<g_buf<<endl;
> }
> curl_easy_cleanup(curl);
> }
> return 0;}
>
>
>
> ///////////////////////////////////////////////////////////////////////////////
> it always return 400.
> Collapse | Copy
> Code<
> http://www.codeproject.com/Questions/490432/usepluslibcurlplustoplussendplushttpplusdeleteplus#
> >
>
> <html><head><title>400 Bad Request</title></head><body
> bgcolor="white"><center><h1>400 Bad
> Request</h1></center><hr><center>nginx/1.2.4</center></body></html>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://cool.haxx.se/pipermail/curl-library/attachments/20121107/255432eb/attachment.html
> >
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> curl-library mailing list
> curl-library_at_cool.haxx.se
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-library
>
>
> ------------------------------
>
> End of curl-library Digest, Vol 87, Issue 10
> ********************************************
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-11-07