How to pass API Key when using POST/GET

Hello all,

I am currently running API automation and am required to pass my API Key as well.

I am thinking I need to add this to my header EX: header={“x-apikey” : ‘key’} But I have tried this in numerous ways and it has failed… I am also thinking this can be added to the request body…

can anyone assist please and thank you!

What library are you using? I recently did this with Browser’s HTTP keyword

1 Like

With RequestsLibrary you can easily do that.
In this file you can find examples how to set headers once for all the requests executed on the same session or how to set headers only for a specific request.

2 Likes

Hello… Sorry for late response. My Dev peeps went a different route and I am up and running… Thanks for the assist!

1 Like

Hi, I’m also facing the same issue can you please help me on that

Hi Abinashbeura,

It’s probably best to start a new topic rather than trying to revive this 3 year old topic.

Also when you do, to get the best help, mention the library you are using what you’ve tried and what errors you are getting. the more information you give about the issue your facing the better the help you’ll get.

Dave.

1 Like