While I understand that I can set headers at the configuration level, it would be extra convenient to be able to set headers at runtime against the instance.
My initial use-case would be to set the Authorization header (i.e., I have a JWT that I want to use for a session). As it stands, if I'm not mistaken, I can only override the \CURLOPT_HTTPHEADER array, but I cannot add to it.
In other words, I have a default Content-Type in my configuration, but I want to add the Authorization header at runtime after I've authenticated and gotten my token.
While I understand that I can set headers at the configuration level, it would be extra convenient to be able to set headers at runtime against the instance.
My initial use-case would be to set the
Authorizationheader (i.e., I have a JWT that I want to use for a session). As it stands, if I'm not mistaken, I can only override the\CURLOPT_HTTPHEADERarray, but I cannot add to it.In other words, I have a default
Content-Typein my configuration, but I want to add theAuthorizationheader at runtime after I've authenticated and gotten my token.