1<testcase>
2<info>
3<keywords>
4HTTP
5HTTP GET
6--libcurl
7</keywords>
8</info>
9
10# Server-side
11<reply>
12<data>
13HTTP/1.1 200 OK
14Date: Thu, 29 Jul 2008 14:49:00 GMT
15Server: test-server/fake
16Content-Length: 0
17Connection: close
18
19</data>
20</reply>
21
22# Client-side
23<client>
24<server>
25http
26</server>
27 <name>
28--libcurl for simple HTTP GET
29 </name>
30<setenv>
31SSL_CERT_FILE=
32</setenv>
33 <command>
34http://%HOSTIP:%HTTPPORT/we/want/1400 --libcurl log/test1400.c
35</command>
36</client>
37
38# Verify data after the test has been "shot"
39<verify>
40<protocol>
41GET /we/want/1400 HTTP/1.1
42Host: %HOSTIP:%HTTPPORT
43User-Agent: curl/%VERSION
44Accept: */*
45
46</protocol>
47<stripfile>
48s/(USERAGENT, \")[^\"]+/${1}stripped/
49# CURLOPT_SSL_VERIFYPEER, SSH_KNOWNHOSTS and HTTP_VERSION vary with
50# CURLOPT_INTERLEAVEDATA requires RTSP protocol
51# configurations - just ignore them
52$_ = '' if /CURLOPT_SSL_VERIFYPEER/
53$_ = '' if /CURLOPT_SSH_KNOWNHOSTS/
54$_ = '' if /CURLOPT_HTTP_VERSION/
55$_ = '' if /CURLOPT_HTTP09_ALLOWED/
56$_ = '' if /CURLOPT_INTERLEAVEDATA/
57</stripfile>
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>
64
65int main(int argc, char *argv[])
66{
67  CURLcode ret;
68  CURL *hnd;
69
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_USERAGENT, "stripped");
74  curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L);
75  curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
76  curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);
77
78  /* Here is a list of options the curl code used that cannot get generated
79     as source easily. You may select to either not use them or implement
80     them yourself.
81
82  CURLOPT_WRITEDATA set to a objectpointer
83  CURLOPT_WRITEFUNCTION set to a functionpointer
84  CURLOPT_READDATA set to a objectpointer
85  CURLOPT_READFUNCTION set to a functionpointer
86  CURLOPT_SEEKDATA set to a objectpointer
87  CURLOPT_SEEKFUNCTION set to a functionpointer
88  CURLOPT_ERRORBUFFER set to a objectpointer
89  CURLOPT_STDERR set to a objectpointer
90  CURLOPT_DEBUGFUNCTION set to a functionpointer
91  CURLOPT_DEBUGDATA set to a objectpointer
92  CURLOPT_HEADERFUNCTION set to a functionpointer
93  CURLOPT_HEADERDATA set to a objectpointer
94
95  */
96
97  ret = curl_easy_perform(hnd);
98
99  curl_easy_cleanup(hnd);
100  hnd = NULL;
101
102  return (int)ret;
103}
104/**** End of sample code ****/
105</file>
106</verify>
107</testcase>
108