1 /*****************************************************************************
3 * Project ___| | | | _ \| |
5 * | (__| |_| | _ <| |___
6 * \___|\___/|_| \_\_____|
14 * Test a simple OPTIONS request with a custom header
20 struct curl_slist *custom_headers=NULL;
22 if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
23 fprintf(stderr, "curl_global_init() failed\n");
24 return TEST_ERR_MAJOR_BAD;
27 if ((curl = curl_easy_init()) == NULL) {
28 fprintf(stderr, "curl_easy_init() failed\n");
29 curl_global_cleanup();
30 return TEST_ERR_MAJOR_BAD;
33 /* Dump data to stdout for protocol verification */
34 test_setopt(curl, CURLOPT_HEADERDATA, stdout);
35 test_setopt(curl, CURLOPT_WRITEDATA, stdout);
37 test_setopt(curl, CURLOPT_URL, URL);
38 test_setopt(curl, CURLOPT_RTSP_STREAM_URI, URL);
39 test_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_OPTIONS);
40 test_setopt(curl, CURLOPT_USERAGENT, "test567");
42 custom_headers = curl_slist_append(custom_headers, "Test-Number: 567");
43 test_setopt(curl, CURLOPT_RTSPHEADER, custom_headers);
45 res = curl_easy_perform(curl);
50 curl_slist_free_all(custom_headers);
51 curl_easy_cleanup(curl);
52 curl_global_cleanup();