C# Класс LibCurl.Curl

Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Cleanup ( ) : void

Cleanup all resources

DisableVerifySSL ( ) : void

Disable verify SSL

Dispose ( ) : void
EnableCookies ( string file ) : void

Enable cookies and read from the file specified. If the file is not present, it is not created. Use SaveCookies to save to the file.

GetCookies ( ) : SList

Get the current cookies. You must have already have called EnableCookies()

GetError ( CURLcode code ) : string

Get the curl error

GetObject ( IntPtr userdata ) : object

Returns the object passed to a Set...Data function. Cast back to the original object.

Perform ( ) : CURLcode

Perform the curl operation

SaveCookies ( string file ) : void

Save the cookies to the file specified.

SetCustomPostRequest ( ) : CURLcode

Custom "POST" request

SetDebugData ( object data ) : CURLcode

Object to pass to OnDebugCallback.

SetFollowLocation ( bool flag ) : CURLcode

Follow

SetHeader ( SList list ) : CURLcode

Set the Headers

SetHeaderData ( object data ) : CURLcode

Object to pass to OnHeaderCallback.

SetOpt ( CURLoption option, IntPtr param ) : CURLcode

Set the Curl option

SetOpt ( CURLoption option, long param ) : CURLcode

Set the Curl option

SetOpt ( CURLoption option, string parameter ) : CURLcode

Set the Curl option

SetPost ( ) : CURLcode

Post

SetPostFieldSize ( int size ) : CURLcode
SetPostFields ( string postFields ) : CURLcode

Set the post fields

SetProgressData ( object data ) : CURLcode

Object to pass to OnProgressCallback. Use curl.GetObject to convert the passed IntPtr back into the object, then cast.

SetPut ( ) : CURLcode

Put

SetReadData ( object data ) : CURLcode

Object to pass to OnReadCallback. Use curl.GetObject to convert the passed IntPtr back into the object, then cast.

SetTimeout ( int value ) : void

Response timeout

SetUpload ( ) : CURLcode

Upload

SetUploadSize ( int value ) : CURLcode

Set the size of the upload

SetUrl ( string url ) : CURLcode

Set the Url

SetUserAgent ( string agent ) : CURLcode

Set the user agent

SetWriteData ( object data ) : CURLcode

Object to pass to OnWriteCallback.

Verbose ( ) : void

Enable verbose messages

Version ( ) : string

Version of CUrl

Приватные методы

Метод Описание
Curl ( ) : System
FreeHandle ( IntPtr &handle ) : void

Free the pinned object

GetHandle ( object obj ) : IntPtr

Pin the object in memory so the C function can find it

curl_easy_cleanup ( IntPtr pCurl ) : void
curl_easy_duphandle ( IntPtr pCurl ) : IntPtr
curl_easy_getinfo ( IntPtr pCurl, CURLINFO info, IntPtr &pInfo ) : CURLcode
curl_easy_getinfo_64 ( IntPtr pCurl, CURLINFO info, double &dblVal ) : CURLcode
curl_easy_init ( ) : IntPtr
curl_easy_perform ( IntPtr pCurl ) : CURLcode
curl_easy_reset ( IntPtr pCurl ) : void
curl_easy_setopt ( IntPtr pCurl, CURLoption opt, IntPtr parm ) : CURLcode
curl_easy_setopt ( IntPtr pCurl, CURLoption opt, _DebugCallbackDelegate callback ) : CURLcode
curl_easy_setopt ( IntPtr pCurl, CURLoption opt, _GenericCallbackDelegate callback ) : CURLcode
curl_easy_setopt ( IntPtr pCurl, CURLoption opt, _ProgressCallbackDelegate callback ) : CURLcode
curl_easy_setopt ( IntPtr pCurl, CURLoption opt, bool parm ) : CURLcode
curl_easy_setopt ( IntPtr pCurl, CURLoption opt, long parm ) : CURLcode
curl_easy_setopt ( IntPtr pCurl, CURLoption opt, string parm ) : CURLcode
curl_easy_strerror ( CURLcode err ) : IntPtr
curl_escape ( String url, int length ) : IntPtr
curl_formfree ( IntPtr pForm ) : void
curl_free ( IntPtr p ) : void
curl_global_cleanup ( ) : void
curl_global_init ( int flags ) : CURLcode
curl_multi_add_handle ( IntPtr pmulti, IntPtr peasy ) : CURLMcode
curl_multi_cleanup ( IntPtr pmulti ) : CURLMcode
curl_multi_init ( ) : IntPtr
curl_multi_perform ( IntPtr pmulti, int &runningHandles ) : CURLMcode
curl_multi_remove_handle ( IntPtr pmulti, IntPtr peasy ) : CURLMcode
curl_multi_strerror ( CURLMcode errorNum ) : IntPtr
curl_share_cleanup ( IntPtr pShare ) : CURLSHcode
curl_share_init ( ) : IntPtr
curl_share_setopt ( IntPtr pShare, CURLSHoption optCode, IntPtr option ) : CURLSHcode
curl_share_strerror ( CURLSHcode errorCode ) : IntPtr
curl_slist_append ( IntPtr slist, string data ) : IntPtr
curl_slist_free_all ( IntPtr pList ) : CURLSHcode
curl_unescape ( String url, int length ) : IntPtr
curl_version ( ) : IntPtr
curl_version_info ( CURLversion ver ) : IntPtr
internal_OnDebugCallback ( IntPtr ptrCurl, CURLINFOTYPE infoType, string message, int size, IntPtr ptrUserdata ) : int
internal_OnHeaderCallback ( IntPtr ptrBuffer, int sz, int nmemb, IntPtr ptrUserdata ) : int
internal_OnReadCallback ( IntPtr ptrBuffer, int sz, int nmemb, IntPtr ptrUserdata ) : int
internal_OnWriteCallback ( IntPtr ptrBuffer, int sz, int nmemb, IntPtr ptrUserdata ) : int
internal_ProgressCallback ( IntPtr ptrUserdata, double dlTotal, double dlNow, double ulTotal, double ulNow ) : int

Описание методов

Cleanup() публичный Метод

Cleanup all resources
public Cleanup ( ) : void
Результат void

DisableVerifySSL() публичный Метод

Disable verify SSL
public DisableVerifySSL ( ) : void
Результат void

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

EnableCookies() публичный Метод

Enable cookies and read from the file specified. If the file is not present, it is not created. Use SaveCookies to save to the file.
public EnableCookies ( string file ) : void
file string
Результат void

GetCookies() публичный Метод

Get the current cookies. You must have already have called EnableCookies()
public GetCookies ( ) : SList
Результат SList

GetError() публичный Метод

Get the curl error
public GetError ( CURLcode code ) : string
code CURLcode
Результат string

GetObject() публичный статический Метод

Returns the object passed to a Set...Data function. Cast back to the original object.
public static GetObject ( IntPtr userdata ) : object
userdata IntPtr
Результат object

Perform() публичный Метод

Perform the curl operation
public Perform ( ) : CURLcode
Результат CURLcode

SaveCookies() публичный Метод

Save the cookies to the file specified.
public SaveCookies ( string file ) : void
file string
Результат void

SetCustomPostRequest() публичный Метод

Custom "POST" request
public SetCustomPostRequest ( ) : CURLcode
Результат CURLcode

SetDebugData() публичный Метод

Object to pass to OnDebugCallback.
public SetDebugData ( object data ) : CURLcode
data object
Результат CURLcode

SetFollowLocation() публичный Метод

Follow
public SetFollowLocation ( bool flag ) : CURLcode
flag bool
Результат CURLcode

SetHeader() публичный Метод

Set the Headers
public SetHeader ( SList list ) : CURLcode
list SList
Результат CURLcode

SetHeaderData() публичный Метод

Object to pass to OnHeaderCallback.
public SetHeaderData ( object data ) : CURLcode
data object
Результат CURLcode

SetOpt() публичный Метод

Set the Curl option
public SetOpt ( CURLoption option, IntPtr param ) : CURLcode
option CURLoption
param IntPtr
Результат CURLcode

SetOpt() публичный Метод

Set the Curl option
public SetOpt ( CURLoption option, long param ) : CURLcode
option CURLoption
param long
Результат CURLcode

SetOpt() публичный Метод

Set the Curl option
public SetOpt ( CURLoption option, string parameter ) : CURLcode
option CURLoption
parameter string
Результат CURLcode

SetPost() публичный Метод

Post
public SetPost ( ) : CURLcode
Результат CURLcode

SetPostFieldSize() публичный Метод

public SetPostFieldSize ( int size ) : CURLcode
size int
Результат CURLcode

SetPostFields() публичный Метод

Set the post fields
public SetPostFields ( string postFields ) : CURLcode
postFields string
Результат CURLcode

SetProgressData() публичный Метод

Object to pass to OnProgressCallback. Use curl.GetObject to convert the passed IntPtr back into the object, then cast.
public SetProgressData ( object data ) : CURLcode
data object
Результат CURLcode

SetPut() публичный Метод

Put
public SetPut ( ) : CURLcode
Результат CURLcode

SetReadData() публичный Метод

Object to pass to OnReadCallback. Use curl.GetObject to convert the passed IntPtr back into the object, then cast.
public SetReadData ( object data ) : CURLcode
data object
Результат CURLcode

SetTimeout() публичный Метод

Response timeout
public SetTimeout ( int value ) : void
value int
Результат void

SetUpload() публичный Метод

Upload
public SetUpload ( ) : CURLcode
Результат CURLcode

SetUploadSize() публичный Метод

Set the size of the upload
public SetUploadSize ( int value ) : CURLcode
value int
Результат CURLcode

SetUrl() публичный Метод

Set the Url
public SetUrl ( string url ) : CURLcode
url string
Результат CURLcode

SetUserAgent() публичный Метод

Set the user agent
public SetUserAgent ( string agent ) : CURLcode
agent string
Результат CURLcode

SetWriteData() публичный Метод

Object to pass to OnWriteCallback.
public SetWriteData ( object data ) : CURLcode
data object
Результат CURLcode

Verbose() публичный Метод

Enable verbose messages
public Verbose ( ) : void
Результат void

Version() публичный статический Метод

Version of CUrl
public static Version ( ) : string
Результат string