Bru Tag Reference
meta
Store metadata about your request
meta {
name: Get users
type: http
seq: 1
tags: [
smoke
sanity
]
}
The seq is used to store the sequence number. This decides the sort position of your request in the UI.
The type can be either http or graphql
The tags is an array of strings that can be used to filter requests during collection runs. Tags are useful for organizing and selectively running requests based on categories like environment, functionality, or priority.
get
Make a GET http call
get {
url: https://api.github.com/users/usebruno
}
post
Make a POST http call
post {
url: https://api.github.com/users/usebruno
}
put
Make a PUT http call
put {
url: https://api.github.com/users/usebruno
}
delete
Make a DELETE http call
delete {
url: https://api.github.com/users/usebruno
}
options
Make a get OPTIONS call
options {
url: https://api.github.com/users/usebruno
}
trace
Make a TRACE http call
trace {
url: https://api.github.com/users/usebruno
}
connect
Make a CONNECT http call
connect {
url: https://api.github.com/users/usebruno
}
head
Make a HEAD http call
head {
url: https://api.github.com/users/usebruno
}
query
The request query params
get {
url: https://api.textlocal.in/send?apiKey=secret&numbers=9988776655&message=hello
}
params:query {
@description('''Your API access key''')
apiKey: secret
@description('''Comma-separated list of recipient numbers''')
numbers: 9988776655
message: hello
}
path
The request path params
get {
url: https://api.textlocal.in/user/:userId
}
params:path {
userId: 13
}
headers
The request headers
get {
url: https://api.textlocal.in/send?apiKey=secret&numbers=9988776655&message=hello
}
headers {
content-type: application/json
@description('''Bearer token obtained after login. Expires in 24 hours.''')
Authorization: Bearer topsecret
}
body
The request body (defaults to json)
body {
{
username: 'john',
password: 'governingdynamics'
}
}
body:text
The request body as text
body:text {
This is a text body
}
body:xml
The request body as xml
body:xml {
<xml>
<name>John</name>
<age>30</age>
</xml>
}
body:form-urlencoded
The request body as form-urlencoded
body:form-urlencoded {
@description('''Your API access key''')
apikey: secret
@description('''Recipient phone number with country code''')
numbers: +91998877665
~message: hello
}
Use @description before a field to document what it represents. Descriptions are optional.
body:multipart-form
The request body as multipart-form
body:multipart-form {
@description('''Your API access key''')
apikey: secret
@description('''Recipient phone number with country code''')
numbers: +91998877665
~message: hello
}
Use @description before a field to document what it represents. Descriptions are optional.
body:graphql
The request body as graphql
body:graphql {
{
launchesPast {
launch_site {
site_name
}
launch_success
}
}
}
body:graphql:vars
The request body as graphql vars
body:graphql:vars {
{
"limit": 5
}
}
script:pre-request
The request body as pre-request
script:pre-request {
req.setHeader("Authorization", "{{token}}");
}
script:post-response
The request body as post-response
script:post-response {
bru.setVar("token", res.body.token);
}
test
The tests
body:test {
expect(res.status).to.equal(200);
}