1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- #include <stdio.h>
- #include <curl/curl.h>
- int main(void)
- {
- CURL *curl;
- CURLcode res;
- curl = curl_easy_init();
- if(curl) {
- curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
- curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "OPTIONS");
-
- curl_easy_setopt(curl, CURLOPT_REQUEST_TARGET, "*");
-
- curl_easy_setopt(curl, CURLOPT_QUICK_EXIT, 1L);
-
- res = curl_easy_perform(curl);
-
- if(res != CURLE_OK)
- fprintf(stderr, "curl_easy_perform() failed: %s\n",
- curl_easy_strerror(res));
-
- curl_easy_cleanup(curl);
- }
- return 0;
- }
|