Skip to content

Variables do not expand when using content type application/x-www-form-urlencoded #490

@kvrohit

Description

@kvrohit

Prerequisites

  • I am using the latest stable release of Neovim
  • I am using the latest version of the plugin

Neovim Version

0.10.2

Operating system/version

Ubuntu (WSL)

Actual behavior

Variables do not expand with POST content type application/x-www-form-urlencoded

Expected behavior

Variable expansion should be supported.

Steps to reproduce

  1. Create a POST request with the following content:
###
# @name PostTest
@var=bar
POST https://postman-echo.com/post
Content-Type: application/x-www-form-urlencoded

foo={{var}}
  1. Execute the request.
  2. Observe the response from the server.

Other information

Response:

{
  "args": {},
  "data": "",
  "files": {},
  "form": {
    "foo": "{{var}}"
  },
  "headers": {
    "host": "postman-echo.com",
    "x-request-start": "t=1730401174.207",
    "connection": "close",
    "content-length": "11",
    "x-forwarded-proto": "https",
    "x-forwarded-port": "443",
    "x-amzn-trace-id": "Root=1-6723d396-0cbe909e583e8e94479fda5e",
    "accept": "*/*",
    "content-type": "application/x-www-form-urlencoded",
    "user-agent": "rest.nvim v3.8.3",
    "cookie": "sails.sid=s%3AGNXG-3IYuvRIqpi1Or_CrvPKWsX6fJb8.uB%2BjZkyfdaQldk28UBWfipofF%2BJ9SRmqeKOA8tG0tGo"
  },
  "json": {
    "foo": "{{var}}"
  },
  "url": "https://postman-echo.com/post"
}

Repro (lazy.nvim)

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
    spec = {
        "rest-nvim/rest.nvim",
        {
            "nvim-treesitter/nvim-treesitter",
            build = ":TSUpdate",
            main = "nvim-treesitter.configs",
            opts = {
                ensure_installed = { "http" },
                sync_install = false,
                highlight = { enable = true },
                indent = { enable = true },
            },
        },
    },
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions