How to add header through blocks to a webapi request?

hi,
i am creating an app which communicates with server…
after logging in, server sends an authorization token…for every request, we have to supply the authorization token in the header… this authorization token changes after some time…so we need a way to set that value in header during program execution…

my question is: how can we set headers in webapi component using code blocks at run time?.. is there any method for it?..i have currently tried the below method( ref: image pleaes), but server is returning error…so something is wrong with the way i did it, i guess…can somebody please provide an example for how to send header via webapi component through code blocks at runtime?

1 Like

Although what you did could be correct, most servers expect headers to be in object format not as plain text.

You will need the create object block from the object drawer to do that and add the required keys and corresponding values. You do not need to add “:” as it will be adding by the object block.

An example from another post
3e753eb16c96506860c78e8ced05252ca0a20fc2

1 Like

thanks @muneer … your answer solved the issue!!!

1 Like