title: WidgetMessage: tm-http-request Example - Basic Authentication tags: $:/tags/Global !! HTTP Basic Authentication [[HTTP Basic Authentication|https://en.wikipedia.org/wiki/Basic_access_authentication]] is a simple scheme for HTTP clients pass a username and password to an HTTP server. The credentials are passed via the "Authorization" header as the string "Basic " (note the space) followed by the base64-encoded username and password joined with a colon. Here is a simple, illustrative example: ``` \procedure get-tiddler-list-from-tiddlywiki-server(url,username,password) \procedure completion-get-json() \import [subfilter{$:/core/config/GlobalImportFilter}] <$action-log msg="In completion-get-json"/> <$action-log/> \end completion-get-json <$action-sendmessage $message="tm-http-request" url=<> method="GET" header-Authorization={{{ [addsuffix[:]addsuffixencodebase64[]addprefix[Basic ]] }}} oncompletion=<> /> \end get-tiddler-list-from-tiddlywiki-server <$button> <> Download ```