14 Date: Thu, 29 Jul 2008 14:49:00 GMT
15 Server: test-server/fake
28 --libcurl for simple HTTP GET
34 http://%HOSTIP:%HTTPPORT/we/want/1400 --libcurl log/test1400.c
38 # Verify data after the test has been "shot"
44 GET /we/want/1400 HTTP/1.1
45 User-Agent: curl/7.18.2 (i686-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.7a ipv6 zlib/1.1.4
46 Host: %HOSTIP:%HTTPPORT
51 s/(USERAGENT, \")[^\"]+/${1}stripped/
52 # CURLOPT_SSL_VERIFYPEER, SSH_KNOWNHOSTS and HTTP_VERSION vary with
53 # configurations - just ignore them
54 $_ = '' if /CURLOPT_SSL_VERIFYPEER/
55 $_ = '' if /CURLOPT_SSH_KNOWNHOSTS/
56 $_ = '' if /CURLOPT_HTTP_VERSION/
58 <file name="log/test1400.c" mode="text">
59 /********* Sample code generated by the curl command line tool **********
60 * All curl_easy_setopt() options are documented at:
61 * https://curl.haxx.se/libcurl/c/curl_easy_setopt.html
62 ************************************************************************/
63 #include <curl/curl.h>
65 int main(int argc, char *argv[])
70 hnd = curl_easy_init();
71 curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
72 curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/1400");
73 curl_easy_setopt(hnd, CURLOPT_HEADER, 1L);
74 curl_easy_setopt(hnd, CURLOPT_USERAGENT, "stripped");
75 curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L);
76 curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
77 curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);
79 /* Here is a list of options the curl code used that cannot get generated
80 as source easily. You may select to either not use them or implement
83 CURLOPT_WRITEDATA set to a objectpointer
84 CURLOPT_INTERLEAVEDATA set to a objectpointer
85 CURLOPT_WRITEFUNCTION set to a functionpointer
86 CURLOPT_READDATA set to a objectpointer
87 CURLOPT_READFUNCTION set to a functionpointer
88 CURLOPT_SEEKDATA set to a objectpointer
89 CURLOPT_SEEKFUNCTION set to a functionpointer
90 CURLOPT_ERRORBUFFER set to a objectpointer
91 CURLOPT_STDERR set to a objectpointer
92 CURLOPT_DEBUGFUNCTION set to a functionpointer
93 CURLOPT_DEBUGDATA set to a objectpointer
94 CURLOPT_HEADERFUNCTION set to a functionpointer
95 CURLOPT_HEADERDATA set to a objectpointer
99 ret = curl_easy_perform(hnd);
101 curl_easy_cleanup(hnd);
106 /**** End of sample code ****/