1 .\" **************************************************************************
3 .\" * Project ___| | | | _ \| |
4 .\" * / __| | | | |_) | |
5 .\" * | (__| |_| | _ <| |___
6 .\" * \___|\___/|_| \_\_____|
8 .\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
10 .\" * This software is licensed as described in the file COPYING, which
11 .\" * you should have received as part of this distribution. The terms
12 .\" * are also available at http://curl.haxx.se/docs/copyright.html.
14 .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 .\" * copies of the Software, and permit persons to whom the Software is
16 .\" * furnished to do so, under the terms of the COPYING file.
18 .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 .\" * KIND, either express or implied.
21 .\" **************************************************************************
23 .TH CURLOPT_NETRC 3 "17 Jun 2014" "libcurl 7.37.0" "curl_easy_setopt options"
25 CURLOPT_NETRC \- request that .netrc is used
27 #include <curl/curl.h>
29 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_NETRC, long level);
31 This parameter controls the preference \fIlevel\fP of libcurl between using
32 user names and passwords from your \fI~/.netrc\fP file, relative to user names
33 and passwords in the URL supplied with \fICURLOPT_URL(3)\fP.
35 libcurl uses a user name (and supplied or prompted password) supplied with
36 \fICURLOPT_USERPWD(3)\fP or \fICURLOPT_USERNAME(3)\fP in preference to any of
37 the options controlled by this parameter.
39 Only machine name, user name and password are taken into account (init macros
40 and similar things aren't supported).
42 libcurl does not verify that the file has the correct properties set (as the
43 standard Unix ftp client does). It should only be readable by user.
45 \fIlevel\fP should be set to one of the values described below.
47 .IP CURL_NETRC_OPTIONAL
48 The use of your \fI~/.netrc\fP file is optional, and information in the URL is
49 to be preferred. The file will be scanned for the host and user name (to
50 find the password only) or for the host only, to find the first user name and
51 password after that \fImachine\fP, which ever information is not specified in
54 Undefined values of the option will have this effect.
55 .IP CURL_NETRC_IGNORED
56 The library will ignore the file and use only the information in the URL.
59 .IP CURL_NETRC_REQUIRED
60 This value tells the library that use of the file is required, to ignore the
61 information in the URL, and to search the file for the host only.
73 .BR CURLOPT_USERPWD "(3), " CURLOPT_USERNAME "(3), "