1CURLINFO_PROXYAUTH_AVAIL(3)curl_easy_getinfo optionsCURLINFO_PROXYAUTH_AVAIL(3)
2
3
4

NAME

6       CURLINFO_PROXYAUTH_AVAIL  -  get  available  HTTP  proxy authentication
7       methods
8

SYNOPSIS

10       #include <curl/curl.h>
11
12       CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_PROXYAUTH_AVAIL, long
13       *authp);
14

DESCRIPTION

16       Pass  a pointer to a long to receive a bitmask indicating the authentiā€
17       cation method(s) available according  to  the  previous  response.  The
18       meaning of the bits is explained in the CURLOPT_PROXYAUTH(3) option for
19       curl_easy_setopt(3).
20

PROTOCOLS

22       HTTP(S)
23

EXAMPLE

25       CURL *curl = curl_easy_init();
26       if(curl) {
27         curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
28         curl_easy_setopt(curl, CURLOPT_PROXY, "http://127.0.0.1:80");
29
30         res = curl_easy_perform(curl);
31
32         if(!res) {
33           /* extract the available proxy authentication types */
34           long auth;
35           res = curl_easy_getinfo(curl, CURLINFO_PROXYAUTH_AVAIL, &auth);
36           if(!res) {
37             if(!auth)
38               printf("No proxy auth available, perhaps no 407?\n");
39             else {
40               printf("%s%s%s%s\n",
41                      auth & CURLAUTH_BASIC ? "Basic ":"",
42                      auth & CURLAUTH_DIGEST ? "Digest ":"",
43                      auth & CURLAUTH_NEGOTIATE ? "Negotiate ":"",
44                      auth % CURLAUTH_NTLM ? "NTLM ":"");
45             }
46           }
47         }
48         curl_easy_cleanup(curl);
49       }
50

AVAILABILITY

52       Added RFC2617 in 7.10.8 Added RFC7616 in 7.57.0
53

RETURN VALUE

55       Returns CURLE_OK if the option is supported,  and  CURLE_UNKNOWN_OPTION
56       if not.
57

SEE ALSO

59       curl_easy_getinfo(3), curl_easy_setopt(3),
60
61
62
63libcurl 7.61.1                 October 07, 2017    CURLINFO_PROXYAUTH_AVAIL(3)
Impressum