Passing the security credentials in REST Search API

I am looking for the way to transfer the credential details for the REST Search API request.
Checked the API specification and haven't found any fields.

Would like to know how the authentication and authorization is being handled when we directly interact with Elasticsearch through API.

Hey,

you can use basic authentication supplying a username and a password in the Authorization header.

--Alex

Nice. Thanks.