Create a collection¶
- Puppers face/bruno → --- → Create Collection → Select location (create directory that matches collection name) → Create
Create a request¶
- Collection name → New request → Enter request name (i.e. _license) → Enter the API URL in the Request URL → Create
- Headers tab → Add Header → Key: Authorization; Value: your_api_key (see below how to enter api key as variable) → Add Header → Key: Content-Type; Value: application/json
- Check Auth tab → Should say Auth inherited from Collection
- Click the arrow button
- Click the floppy disk icon to save the request
Create variables¶
Create environment¶
Top Right → Environments → Configure → Create → Name your environment
Add variables¶
For example:
A URL variable¶
Name: URL
Value: [ elasticsearch_endpoint_url ]
An API_KEY variable¶
Name: API_KEY
Value: ApiKey [ encoded_apikey ]
Use variables in a request¶
Create a new request & add {{URL}}¶
- Select your environment
Collection → New Request → Request Name: my request → URL: {{URL}}
It will create the new request and if you hover over {{URL}} in the request field, it should show you the full value
Add the API_KEY variable to request headers¶
Authorization header¶
Headers → Add header → Key: Authorization, Value: {{API_KEY}}
Add header → Key: Content-Type, Value: application/json
- Note: make sure in the auth tab it is set to inherit
Execute the request¶
Click the run arrow
Automatically add variables to each new request¶
todo