MATLAB: How to add an authorization header with a space in the value, to an http request

header authorization http request space value "value in an authinfo is an encoded username/password"MATLAB

For a http request, I would like to add a Authorization header like this "Authorization" : "api-key lettersAndNumbers". How can I do ? I already tested many solutions using AuthorizationField with or without AuthInfo, and using AuthInfo. . .
From the moment there is a space in the value of the AuthorizationField, Matlabs appears to want absolutely an AuthInfo object
But each time I try to build the AuthInfo, it will end up adding an equal sign or/and quotes surrounding the lettersAndNumbers part. . .
Here is all I tried (not totally all though):
authinfo ='api-key','api-key', 'NDZicHE3MmdybnZ3ZGdjZnh2dHF0NGptc2JnOWtnNzM=')
authinfo ='api-key', 'NDZicHE3MmdybnZ3ZGdjZnh2dHF0NGptc2JnOWtnNzM=')
authinfo =,'api-key', 'NDZicHE3MmdybnZ3ZGdjZnh2dHF0NGptc2JnOWtnNzM=')
authinfo =,'api-key', 'NDZicHE3MmdybnZ3ZGdjZnh2dHF0NGptc2JnOWtnNzM=')
af ="Authorization", authinfo)
af ="Authorization", string("api_key fkfkfkfkfk="))
af ="Authorization: api_key fkfkfkfkfk=")
af ="Authorization", '"api-key MDd6bGw0ZjR3MjI2OTA2cDZuY2dnaHIxYjJsazE4NHE="')
The last one could actually doesnt return any error but adds undesired quotes..
Has anyone tried something similar ?
Thank you for the help 🙂

Best Answer

Sorry for the delay, but yes I had found it a bit later. There is actually a way to add an arbitrary header, using this:
header ="Authorization", "api-key aznfkjndjnsn=");
r ='post', header,;
This way it worked, it added an "Authorization" header without caring about the space.