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_USERPWD 3 "17 Jun 2014" "libcurl 7.37.0" "curl_easy_setopt options"
25 CURLOPT_USERPWD \- set user + password to work with
27 #include <curl/curl.h>
29 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_USERPWD, char *userpwd);
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].
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.
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.
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
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.
62 Returns CURLE_OK on success or
63 CURLE_OUT_OF_MEMORY if there was insufficient heap space.
65 .BR CURLOPT_USERNAME "(3), " CURLOPT_PASSWORD "(3), "