Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
CURLOPT_DI...AME_IN_URL(3) Library Functions Manual CURLOPT_DI...AME_IN_URL(3)

NAME
       CURLOPT_DISALLOW_USERNAME_IN_URL	 - disallow specifying username	in the
       URL

SYNOPSIS
       #include	<curl/curl.h>

       CURLcode	curl_easy_setopt(CURL *handle, CURLOPT_DISALLOW_USERNAME_IN_URL,
				 long disallow);

DESCRIPTION
       A long parameter	set to 1 tells the library to not allow	URLs that  in-
       clude a username.

       This  is	 the  equivalent  to  the  CURLU_DISALLOW_USER	flag  for  the
       curl_url_set(3) function.

DEFAULT
       0 (disabled)

PROTOCOLS
       This functionality affects all supported	protocols

EXAMPLE
       int main(void)
       {
	 CURL *curl = curl_easy_init();
	 if(curl) {

	   curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
	   curl_easy_setopt(curl, CURLOPT_DISALLOW_USERNAME_IN_URL, 1L);

	   curl_easy_perform(curl);
	 }
       }

AVAILABILITY
       Added in	curl 7.61.0

RETURN VALUE
       curl_easy_setopt(3) returns a CURLcode indicating success or error.

       CURLE_OK	(0) means everything was OK, non-zero means an error occurred,
       see libcurl-errors(3).

       curl_easy_perform(3) returns CURLE_LOGIN_DENIED if this option  is  en-
       abled and a URL containing a username is	specified.

SEE ALSO
       CURLOPT_PROTOCOLS_STR(3),  CURLOPT_URL(3), curl_url_set(3), libcurl-se-
       curity(3)

libcurl				  2025-06-03	    CURLOPT_DI...AME_IN_URL(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=CURLOPT_DISALLOW_USERNAME_IN_URL&sektion=3&manpath=FreeBSD+Ports+14.3.quarterly>

home | help