Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

CURL.SetOptionUserName

Sets the user name string for the transfer.

Component Version macOS Windows Linux Server iOS SDK
CURL 2.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "CURL.SetOptionUserName"; curl; Value { ; Encoding } )   More

Parameters

Parameter Description Example Flags
curl The CURL session handle. $curl
Value The user name "cs"
Encoding The text encoding for text parameter.
Default is UTF-8.
Possible encoding names: ANSI, ISO-8859-1, Latin1, Mac, Native, UTF-8, DOS, Hex, Base64 or Windows. More listed in the FAQ.
"UTF8" Optional

Result

Returns "OK" on success.

Description

Sets the user name string for the transfer.
In order to specify the password to be used in conjunction with the user name use the CURL.SetOptionPassword option.
Please check case as some services check names case sensitive.

See also USERNAME option in CURL manual.

Examples

Set login credentials:

Set Variable [ $result ; Wert: MBS("CURL.SetOptionUserName"; $curl; Logins::Username) ]
Set Variable [ $result ; Wert: MBS("CURL.SetOptionPassword"; $curl; Logins::Password) ]

Setup for IMAP with Google GMail:

Set Variable [ $curl ; Value: MBS("CURL.New") ]
Set Variable [ $r ; Value: MBS("CURL.SetOptionPort"; $curl; 993) // IMAP SSL port ]
Set Variable [ $r ; Value: MBS("CURL.SetOptionUseSSL"; $curl; 3) // require SSL ]
Set Variable [ $r ; Value: MBS("CURL.SetOptionSSLVersion"; $curl; 6) // TLSv1.2 ]
Set Variable [ $r ; Value: MBS("CURL.SetOptionURL"; $curl; "imaps://imap.gmail.com/INBOX") ]
Set Variable [ $r ; Value: MBS("CURL.SetOptionUserName"; $curl; $user) ]
Set Variable [ $r ; Value: MBS("CURL.SetOptionPassword"; $curl; $pass) ]

Setup IMAP for Office 365:

Set Variable [ $r ; Value: MBS("CURL.SetOptionURL"; $curl; "imaps://outlook.office365.com/INBOX") ]
Set Variable [ $r ; Value: MBS("CURL.SetOptionXOAuth2Bearer"; $curl; "eyJ0eXAiOi...") ] // your oAuth token
Set Variable [ $r ; Value: MBS("CURL.SetOptionUserName"; $curl; "test@outlook.com") ] // no password needed!

See also

Example Databases

Blog Entries

Created 18th August 2014, last changed 2nd October 2023


CURL.SetOptionUserAgent - CURL.SetOptionVerbose

💬 Ask a question or report a problem