Solvedvscode restclient Header name must be a valid HTTP token ["{"]

I had a previous simple test file that was working
I tried to add a couple of requests in the same file
but now I just get the error above on any request...

I tried reverting any changes to the .http file
but still the extension just gives this invalid error each time i try to load a resource.

  • VSCode Version: Version: 1.38.1

  • OS Version: OSX 10.14.6

  • REST Client Version: 0.22.2

Steps to Reproduce:

  1. make a file with some simple tests like
POST http://localhost:55200/test HTTP/1.1
content-type: application/json
{
    "cname": "weile"
}

all will work fine. wait a while. do something?
then error occurs:

  1. try and run click 'send request'

error message pops up as toast.

20 Answers

✔️Accepted Answer

OK looks like the error is:

POST http://localhost:55200/test HTTP/1.1
content-type: application/json
{
    "cname": "weile"
}

where as this is OK:

POST http://localhost:55200/test HTTP/1.1
content-type: application/json

{
    "cname": "weile"
}

Other Answers:

so the extra line is critical. a bit of a pedantic bug...

Error text about the blank line in message box should be clear.

@dcsan this follows the rules in RFC, and there should be a separated blank line between header and body parts.

More Issues: