%http-cookies(5)%http-cookies - Set HTTP request cookies
%http-header - Set additional HTTP request headers
%http-cookies "cookie=value; ..."; Default is undefined
%http-header ":VERB:"; Default is undefined
%http-header "Header1: value1\r\n ...";
%http-header ":VERB:Header1: value1\r\n ...";
If the %http-cookies variable is set all HTTP file loading requests, using commands like find-file(2), are sent with a Cookie: request header (if not an empty string) and all response Set-Cookie: header values will be merged into the current value, i.e. if the named cookie already exists in the %http-cookies variable its value will be updated.
If the variable is not defined then no Cookie: request header is sent and all response Set-Cookie: headers are ignored.
If the %http-header variable is set, if the first character is a ':' then the string up to the next ':' is used as the HTTP request verb, e.g. POST, PUT, DELETE etc. If the value does not start with a ':' then the default verb, which is either GET or POST, is used. The remainder of the value, if any, is appended to the end of the standard request header, but before the terminating blank line.
When a header is appended, the value is prefixed and suffixed with a '\r\n' newline, therefore if the value starts, ends or contains double newline character sequences the URL request will be invalid.
The %http-cookies variable should take the form of "<name1>=<value1>; <name2>=<value2>; ...; <name#>=<value#>" with no trailing ';', names and values should be URL encoded.
As with variables like @wl 4 , the returned value can be longer than the maximum length of a user defined variable so care is needed if manipulating its value using macro code.
MicroEmacs cookie support is minimal, it does not support domains, expires, paths etc. it is up to the user or supporting macros to implement any additional features required.
%http-header can effect how a file is submitted using %http-post-file(5), see help for the variable for more information.
(c) Copyright JASSPA 2025
Last Modified: 2024/09/02
Generated On: 2025/09/29