Annotation of embedaddon/curl/tests/data/test1401, revision 1.1
1.1 ! misho 1: <testcase>
! 2: <info>
! 3: <keywords>
! 4: HTTP
! 5: HTTP GET
! 6: HTTP Basic auth
! 7: HTTP set cookie
! 8: cookies
! 9: --libcurl
! 10: </keywords>
! 11: </info>
! 12:
! 13: # Server-side
! 14: <reply>
! 15: <data>
! 16: HTTP/1.1 200 OK
! 17: Date: Thu, 29 Jul 2008 14:49:00 GMT
! 18: Server: test-server/fake
! 19: Content-Length: 0
! 20: Content-Type: text/plain
! 21: Connection: close
! 22:
! 23: </data>
! 24: </reply>
! 25:
! 26: # Client-side
! 27: <client>
! 28: <server>
! 29: http
! 30: </server>
! 31: <name>
! 32: --libcurl for GET with various options
! 33: </name>
! 34: <setenv>
! 35: SSL_CERT_FILE=
! 36: </setenv>
! 37: <command>
! 38: http://%HOSTIP:%HTTPPORT/we/want/1401 --libcurl log/test1401.c --basic -u fake:user -H "X-Files: Mulder" -H "X-Men: cyclops, iceman" -A MyUA -b chocolate=chip --proto "=http,ftp,file"
! 39: </command>
! 40: </client>
! 41:
! 42: # Verify data after the test has been "shot"
! 43: <verify>
! 44: <strip>
! 45: ^User-Agent:.*
! 46: </strip>
! 47: <protocol>
! 48: GET /we/want/1401 HTTP/1.1
! 49: Host: %HOSTIP:%HTTPPORT
! 50: User-Agent: stripped
! 51: Authorization: Basic ZmFrZTp1c2Vy
! 52: Accept: */*
! 53: Cookie: chocolate=chip
! 54: X-Files: Mulder
! 55: X-Men: cyclops, iceman
! 56:
! 57: </protocol>
! 58: <stripfile>
! 59: # CURLOPT_SSL_VERIFYPEER, SSH_KNOWNHOSTS and HTTP_VERSION vary with
! 60: # configurations - just ignore them
! 61: $_ = '' if /CURLOPT_SSL_VERIFYPEER/
! 62: $_ = '' if /CURLOPT_SSH_KNOWNHOSTS/
! 63: $_ = '' if /CURLOPT_HTTP_VERSION/
! 64: $_ = '' if /CURLOPT_INTERLEAVEDATA/
! 65: </stripfile>
! 66: <file name="log/test1401.c" mode="text">
! 67: /********* Sample code generated by the curl command line tool **********
! 68: * All curl_easy_setopt() options are documented at:
! 69: * https://curl.haxx.se/libcurl/c/curl_easy_setopt.html
! 70: ************************************************************************/
! 71: #include <curl/curl.h>
! 72:
! 73: int main(int argc, char *argv[])
! 74: {
! 75: CURLcode ret;
! 76: CURL *hnd;
! 77: struct curl_slist *slist1;
! 78:
! 79: slist1 = NULL;
! 80: slist1 = curl_slist_append(slist1, "X-Files: Mulder");
! 81: slist1 = curl_slist_append(slist1, "X-Men: cyclops, iceman");
! 82:
! 83: hnd = curl_easy_init();
! 84: curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
! 85: curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/1401");
! 86: curl_easy_setopt(hnd, CURLOPT_USERPWD, "fake:user");
! 87: curl_easy_setopt(hnd, CURLOPT_HTTPAUTH, (long)CURLAUTH_BASIC);
! 88: curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, slist1);
! 89: curl_easy_setopt(hnd, CURLOPT_USERAGENT, "MyUA");
! 90: curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L);
! 91: curl_easy_setopt(hnd, CURLOPT_COOKIE, "chocolate=chip");
! 92: curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
! 93: curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);
! 94: curl_easy_setopt(hnd, CURLOPT_PROTOCOLS, (long)CURLPROTO_FILE |
! 95: (long)CURLPROTO_FTP |
! 96: (long)CURLPROTO_HTTP);
! 97:
! 98: /* Here is a list of options the curl code used that cannot get generated
! 99: as source easily. You may select to either not use them or implement
! 100: them yourself.
! 101:
! 102: CURLOPT_WRITEDATA set to a objectpointer
! 103: CURLOPT_WRITEFUNCTION set to a functionpointer
! 104: CURLOPT_READDATA set to a objectpointer
! 105: CURLOPT_READFUNCTION set to a functionpointer
! 106: CURLOPT_SEEKDATA set to a objectpointer
! 107: CURLOPT_SEEKFUNCTION set to a functionpointer
! 108: CURLOPT_ERRORBUFFER set to a objectpointer
! 109: CURLOPT_STDERR set to a objectpointer
! 110: CURLOPT_DEBUGFUNCTION set to a functionpointer
! 111: CURLOPT_DEBUGDATA set to a objectpointer
! 112: CURLOPT_HEADERFUNCTION set to a functionpointer
! 113: CURLOPT_HEADERDATA set to a objectpointer
! 114:
! 115: */
! 116:
! 117: ret = curl_easy_perform(hnd);
! 118:
! 119: curl_easy_cleanup(hnd);
! 120: hnd = NULL;
! 121: curl_slist_free_all(slist1);
! 122: slist1 = NULL;
! 123:
! 124: return (int)ret;
! 125: }
! 126: /**** End of sample code ****/
! 127: </file>
! 128: </verify>
! 129: </testcase>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>