diepm / vim-rest-console

A REST console for Vim.
658 stars 54 forks source link

This was working before but now isn't... not sure what I did #56

Closed BrandonShega closed 6 years ago

BrandonShega commented 6 years ago

Hello,

I really like this because I don't have to leave vim to test an endpoint but recently it's stopped working.

I can curl the given url http://localhost:3000/v2/showers and it works fine, I can also use visual studio code's rest client and that works. But whenever I use the vim rest console I just get a blank curl output.

This is what my file looks like:

http://localhost:3000
GET /v2/showers

Accept: application/json
User-Token: <token>

and this is the output I'm getting in the response buffer

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

Also, I can at least see it hitting the server, I think. Whenever I press ctrl+j I get a blank line in my rails log which I believe means it's at least getting to the server but the route is not actually getting hit. Any ideas?

BrandonShega commented 6 years ago

After further inspection it seems I must be doing something wrong, this is the curl command that is actually getting called:

Calling shell to execute: "(curl -H 'Content-Type: application/json' --get --data-urlencode 'User-Token: <token>' 'http://localhost:3000/v2/showers') >/var/folders/fk/_37g5fw56xsc5xszl0mvms0st98cxw/T/vv2xywp/7 2>&1"

It's not putting User-Token as a header but rather as a body, I believe (I'm no curl expert)

BrandonShega commented 6 years ago

User error... I see I have to put headers before the request.