Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding CustomHeader in TRESTClient

I need to add CustomHeader in my restclient to add an apikey.

In my code I use (FRESTClient is TRESTClient)

FRESTClient.SetHTTPHeader('X-XXX-ApiKey', 'fdfd121231212fds');

but it is not set in my http header when I see it on fiddler. What is the way to make this ?

like image 655
Hugues Van Landeghem Avatar asked Mar 05 '23 09:03

Hugues Van Landeghem


1 Answers

Have you tried 'AddParameter'?

FRestClient.AddParameter('<Name>', '<Value>', TRESTRequestParameterKind.pkHTTPHEADER);

http://docwiki.embarcadero.com/Libraries/Rio/en/REST.Client.TCustomRESTClient.AddParameter

like image 106
Chris Avatar answered Mar 18 '23 07:03

Chris