Skip to content

Latest commit

 

History

History
66 lines (53 loc) · 1.11 KB

README.md

File metadata and controls

66 lines (53 loc) · 1.11 KB

Rest

Goes well with rest.nvim

Example:

locals {
  url = "http://localhost:8080"
  asdf = "world"
}

// test
request "hell_yeah" {
  method = "GET"
  headers = [
    "X-TEST: you:😄",
  ]
  url = "${locals.url}/get"
}

request "my_post" {
  method = "POST"
  url = "${locals.url}/post"
  headers = [
    "Content-Type: application/json",
  ]

  body = <<END
  {
    "hello": "${locals.asdf}"
  }
  END
  expect = 200
}

Server/Client:

image

Testing:

image

rest -h
    --no-color, -nc:
        No colors
    --quiet, -q:
        Minimize logging
    --addr, -a:
        Address to listen on
    --serve, -s:
        Run a server
    --dir, -d:
        Directory to serve
    --file, -f:
        File to run
    --block, -b:
        Request block to run
    --label, -l:
        Request label to run