Skip to content

Latest commit

 

History

History
43 lines (38 loc) · 619 Bytes

example.rest

File metadata and controls

43 lines (38 loc) · 619 Bytes
locals {
url = "http://localhost:8080" asdf = "world"

}

// test request "get with header" {

method = "GET" headers = [

"X-TEST: you:😄",

] url = "${locals.url}/get"

}

request "post with body" {

method = "POST" url = "${locals.url}/post" headers = [

"Content-Type: application/json",

]

body = <<END {

"hello": "${locals.asdf}"

} END expect = 200

}

request "post with body that should fail" {

method = "POST" url = "${locals.url}/post" headers = [

"Content-Type: application/json",

]

body = <<END {

"hello": "${locals.asdf}"

} END expect = 401

}