LibCurl.Curl.SetUrl C# (CSharp) Method

SetUrl() public method

Set the Url
public SetUrl ( string url ) : CURLcode
url string
return CURLcode
        public CURLcode SetUrl(string url)
        {
            return curl_easy_setopt(m_pCURL, CURLoption.CURLOPT_URL, url);
        }

Usage Example

コード例 #1
1
ファイル: BookPost.cs プロジェクト: trustme/LibCurlDotNet
        public void Perform()
        {
            try
            {
                using (Curl curl = new Curl())
                {
                    //Curl.GlobalInit((int)CURLinitFlag.CURL_GLOBAL_ALL);

                    curl.OnWriteCallback = new Curl.GenericCallbackDelegate(OnWriteData);
                    curl.SetWriteData(null);

                    // simple post - with a string
                    curl.SetPost();
                    curl.SetPostFields("url=index%3Dstripbooks&field-keywords=Topology&Go.x=10&Go.y=10");

                    curl.SetUserAgent("Mozilla 4.0 (compatible; MSIE 6.0; Win32");
                    curl.SetFollowLocation(true);
                    curl.SetUrl("http://www.amazon.com/exec/obidos/search-handle-form/002-5928901-6229641");

                    curl.Perform();
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }
All Usage Examples Of LibCurl.Curl::SetUrl