Revert "Update to 7.40.1"
[platform/upstream/curl.git] / docs / libcurl / opts / CURLOPT_USERPWD.3
1 .\" **************************************************************************
2 .\" *                                  _   _ ____  _
3 .\" *  Project                     ___| | | |  _ \| |
4 .\" *                             / __| | | | |_) | |
5 .\" *                            | (__| |_| |  _ <| |___
6 .\" *                             \___|\___/|_| \_\_____|
7 .\" *
8 .\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
9 .\" *
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.
13 .\" *
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.
17 .\" *
18 .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 .\" * KIND, either express or implied.
20 .\" *
21 .\" **************************************************************************
22 .\"
23 .TH CURLOPT_USERPWD 3 "17 Jun 2014" "libcurl 7.37.0" "curl_easy_setopt options"
24 .SH NAME
25 CURLOPT_USERPWD \- set user + password to work with
26 .SH SYNOPSIS
27 #include <curl/curl.h>
28
29 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_USERPWD, char *userpwd);
30 .SH DESCRIPTION
31 Pass a char * as parameter, pointing to a zero terminated login details string
32 for the connection. The format of which is: [user name]:[password].
33
34 When using NTLM, you can set the domain by prepending it to the user name and
35 separating the domain and name with a forward (/) or backward slash (\\). Like
36 this: "domain/user:password" or "domain\\user:password". Some HTTP servers (on
37 Windows) support this style even for Basic authentication.
38
39 When using HTTP and \fICURLOPT_FOLLOWLOCATION(3)\fP, libcurl might perform
40 several requests to possibly different hosts. libcurl will only send this user
41 and password information to hosts using the initial host name (unless
42 \fICURLOPT_UNRESTRICTED_AUTH(3)\fP is set), so if libcurl follows locations to
43 other hosts it will not send the user and password to those. This is enforced
44 to prevent accidental information leakage.
45
46 Use \fICURLOPT_HTTPAUTH(3)\fP to specify the authentication method for HTTP
47 based connections or \fICURLOPT_LOGIN_OPTIONS(3)\fP to control IMAP, POP3 and
48 SMTP options.
49
50 The user and password strings are not URL decoded, so there's no way to send
51 in a user name containing a colon using this option. Use
52 \fICURLOPT_USERNAME(3)\fP for that, or include it in the URL.
53 .SH DEFAULT
54 NULL
55 .SH PROTOCOLS
56 Most
57 .SH EXAMPLE
58 TODO
59 .SH AVAILABILITY
60 Always
61 .SH RETURN VALUE
62 Returns CURLE_OK on success or
63 CURLE_OUT_OF_MEMORY if there was insufficient heap space.
64 .SH "SEE ALSO"
65 .BR CURLOPT_USERNAME "(3), " CURLOPT_PASSWORD "(3), "