Ujjawal Khare
Ujjawal Khare

Reputation: 796

How to pass basic authentication to API call in robotframework

I am trying to learn robot framework and I am trying to connect my https API using BASIC authentication. Can anyone help me to start with initial setup ?
Attached is the screenshot how Iam currently connecting the REST API.

An example I found on GITHUB looked promising but no idea how to use it in my case. https://github.com/jjwong/RESTinstance_starter_project/blob/master/tests/test_basic_authentication.robot enter image description here

enter image description here

Upvotes: 0

Views: 5198

Answers (1)

Yash Jagdale
Yash Jagdale

Reputation: 1508

You might need to add your username and password in headers of your request like

Authorization    Basic username:password

Note you need to encode it with base64.

In case of Token based authentication

Authorization    Bearer ${jwt_token}

Upvotes: 2

Related Questions