赞
踩
转自:http://blog.csdn.net/benjiamen/article/details/2492567
仅供参考
CURL类库返回说明
curl_easy_perform()返回值说明
response=curl_easy_perform(curl);
response返回的状态值
CURLE_OK: printf("send ok!/n");
CURLE_HTTP_POST_ERROR: printf("post error!/n");
CURLE_COULDNT_CONNECT: printf("cannot connect to server/n");
CURLE_OK = 0, /* 0 */ no error
CURLE_UNSUPPORTED_PROTOCOL, /* 1 */ unsupported protocol
CURLE_FAILED_INIT, /* 2 */ failed init
CURLE_URL_MALFORMAT, /* 3 */ URL using bad/illegal format or missing URL
CURLE_URL_MALFORMAT_USER, /* 4 - NOT USED */ unknown error
CURLE_COULDNT_RESOLVE_PROXY, /* 5 */ couldn't resolve proxy name
CURLE_COULDNT_RESOLVE_HOST, /* 6 */ couldn't resolve host name
CURLE_COULDNT_CONNECT, /* 7 */ couldn't connect to server
CURLE_FTP_WEIRD_SERVER_REPLY, /* 8 */ FTP: weird server reply
CURLE_FTP_ACCESS_DENIED, /* 9 a service was denied by the FTP server */ FTP:access denied due to lack of access - when login fails this is not returned.
CURLE_FTP_USER_PASSWORD_INCORRECT,
/* 10 - NOT USED */unknown error
CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */ FTP: unknown PASS reply
CURLE_FTP_WEIRD_USER_REPLY, /* 12 */ FTP: unknown USER reply
CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */ FTP: unknown PASV reply
CURLE_FTP_WEIRD_227_FORMAT, /* 14 */ FTP: unknown 227 response format
CURLE_FTP_CANT_GET_HOST, /* 15 */ FTP: can't figure out the host in the PASV response
CURLE_FTP_CANT_RECONNECT, /* 16 */ FTP: can't connect to server the response code is unknown
CURLE_FTP_COULDNT_SET_BINARY, /* 17 */ FTP: couldn't set binary mode
CURLE_PARTIAL_FILE, /* 18 */ Transferred a partial file
CURLE_FTP_COULDNT_RETR_FILE, /* 19 */ FTP: couldn't retrieve (RETR failed) the specified file
CURLE_FTP_WRITE_ERROR, /* 20 */ FTP: the post-transfer acknowledge response was not OK
CURLE_FTP_QUOTE_ERROR, /* 21 */ FTP: a quote command returned error
CURLE_HTTP_RETURNED_ERROR, /* 22 */ HTTP response code said error
CURLE_WRITE_ERROR, /* 23 */ failed writing received data to disk/application
CURLE_MALFORMAT_USER, /* 24 - NOT USED */ 24: unknown error
CURLE_UPLOAD_FAILED, /* 25 - failed upload "command" */ upload failed (at start/before it took off)
CURLE_READ_ERROR, /* 26 */ failed to open/read local data from file/application
CURLE_OUT_OF_MEMORY, /* 27 */ out of memory
/* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error
instead of a memory allocation error if CURL_DOES_CONVERSIONS
is defined */
CURLE_OPERATION_TIMEOUTED, /* 28 - the timeout time was reached */ a timeout was reached
CURLE_FTP_COULDNT_SET_ASCII, /* 29 - TYPE A failed */ FTP could not set ASCII mode (TYPE A)
CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */ FTP command PORT failed
CURLE_FTP_COULDNT_USE_REST, /* 31 - the REST command failed */ FTP command REST failed
CURLE_FTP_COULDNT_GET_SIZE, /* 32 - the SIZE command failed */ FTP command SIZE failed
CURLE_HTTP_RANGE_ERROR, /* 33 - RANGE "command" didn't work */ a range was requested but the server did not deliver it
CURLE_HTTP_POST_ERROR, /* 34 */ internal problem setting up the POST
CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */ SSL connect error
CURLE_BAD_DOWNLOAD_RESUME, /* 36 - couldn't resume download */ couldn't resume download
CURLE_FILE_COULDNT_READ_FILE, /* 37 */ couldn't read a file:// file
CURLE_LDAP_CANNOT_BIND, /* 38 */ LDAP: cannot bind
CURLE_LDAP_SEARCH_FAILED, /* 39 */ LDAP: search failed
CURLE_LIBRARY_NOT_FOUND, /* 40 */ a required shared library was not found
CURLE_FUNCTION_NOT_FOUND, /* 41 */ a required function in the shared library was not found
CURLE_ABORTED_BY_CALLBACK, /* 42 */ the operation was aborted by an application callback
CURLE_BAD_FUNCTION_ARGUMENT, /* 43 */ a libcurl function was given a bad argument
CURLE_BAD_CALLING_ORDER, /* 44 - NOT USED */ unknown error
CURLE_INTERFACE_FAILED, /* 45 - CURLOPT_INTERFACE failed */ failed binding local connection end
CURLE_BAD_PASSWORD_ENTERED, /* 46 - NOT USED */ unknown error
CURLE_TOO_MANY_REDIRECTS , /* 47 - catch endless re-direct loops */ number of redirects hit maximum amount
CURLE_UNKNOWN_TELNET_OPTION, /* 48 - User specified an unknown option */ User specified an unknown option
CURLE_TELNET_OPTION_SYNTAX , /* 49 - Malformed telnet option */ Malformed telnet option
CURLE_OBSOLETE, /* 50 - NOT USED */ 50: unknown error
CURLE_SSL_PEER_CERTIFICATE, /* 51 - peer's certificate wasn't ok */ SSL peer certificate was not ok
CURLE_GOT_NOTHING, /* 52 - when this is a specific error */ server returned nothing (no headers, no data)
CURLE_SSL_ENGINE_NOTFOUND, /* 53 - SSL crypto engine not found */ SSL crypto engine not found
CURLE_SSL_ENGINE_SETFAILED, /* 54 - can not set SSL crypto engine as default */
CURLE_SEND_ERROR, /* 55 - failed sending network data */ failed sending data to the peer
CURLE_RECV_ERROR, /* 56 - failure in receiving network data */ failure when receiving data from the peer
CURLE_SHARE_IN_USE, /* 57 - share is in use */ share is already in use
CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */ problem with the local SSL certificate
CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */ couldn't use specified SSL cipher
CURLE_SSL_CACERT, /* 60 - problem with the CA cert (path?) */ peer certificate cannot be authenticated with known CA certificates
CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized transfer encoding */ Unrecognized HTTP Content-Encoding
CURLE_LDAP_INVALID_URL, /* 62 - Invalid LDAP URL */ Invalid LDAP URL
CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */ Maximum file size exceeded
CURLE_FTP_SSL_FAILED, /* 64 - Requested FTP SSL level failed */ Requested FTP SSL level failed
CURLE_SEND_FAIL_REWIND, /* 65 - Sending the data requires a rewind */ Send failed since rewinding of the data stream failed that failed */
CURLE_SSL_ENGINE_INITFAILED, /* 66 - failed to initialise ENGINE */ failed to initialise SSL crypto engine
CURLE_LOGIN_DENIED, /* 67 - FTP: login denied */ user, password or similar was notaccepted and we failed to login */
CURLE_TFTP_NOTFOUND, /* 68 - file not found on server */ TFTP: File Not Found
CURLE_TFTP_PERM, /* 69 - permission problem on server */ TFTP: Access Violation
CURLE_TFTP_DISKFULL, /* 70 - out of disk space on server */ TFTP: Disk full or allocation exceeded
CURLE_TFTP_ILLEGAL, /* 71 - Illegal TFTP operation */ TFTP: Illegal operation
CURLE_TFTP_UNKNOWNID, /* 72 - Unknown transfer ID */ TFTP: Unknown transfer ID
CURLE_TFTP_EXISTS, /* 73 - File already exists */ TFTP: File already exists
CURLE_TFTP_NOSUCHUSER, /* 74 - No such user */ TFTP: No such user
CURLE_CONV_FAILED, /* 75 - conversion failed */ conversion failed
CURLE_CONV_REQD, /* 76 - caller must register conversion */
CURLE_SSL_CACERT_BADFILE, /* 77 - could not load CACERT file, missing or wrong format */problem with the SSL CA cert (path? access rights?)
CURLE_REMOTE_FILE_NOT_FOUND, /* 78 - remote file not found */ Remote file not found
CURLE_SSH, /* 79 -Error in the SSH layer */ error from the SSH layer, somewhat generic so the error message will be of interest when this has happened
CURLE_SSL_SHUTDOWN_FAILED, /* 80 */ Failed to shut down the SSL connection
也可以参考:http://blog.csdn.net/computerhenu/article/details/7532237
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。