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 = matlab.net.http.AuthInfo('api-key','api-key', 'NDZicHE3MmdybnZ3ZGdjZnh2dHF0NGptc2JnOWtnNzM=')authinfo = matlab.net.http.AuthInfo('api-key', 'NDZicHE3MmdybnZ3ZGdjZnh2dHF0NGptc2JnOWtnNzM=')authinfo = matlab.net.http.AuthInfo(AuthenticationScheme.Basic(),'api-key', 'NDZicHE3MmdybnZ3ZGdjZnh2dHF0NGptc2JnOWtnNzM=')authinfo = matlab.net.http.AuthInfo(AuthenticationScheme.Digest(),'api-key', 'NDZicHE3MmdybnZ3ZGdjZnh2dHF0NGptc2JnOWtnNzM=')af = matlab.net.http.field.AuthorizationField("Authorization", authinfo)af = matlab.net.http.field.AuthorizationField("Authorization", string("api_key fkfkfkfkfk="))af = matlab.net.http.field.AuthorizationField("Authorization: api_key fkfkfkfkfk=")af = matlab.net.http.field.AuthorizationField("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