diepm / vim-rest-console

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

how send nested params in post #12

Closed rlisowski closed 9 years ago

rlisowski commented 9 years ago

I have rest api in rails and params should be nested like user[name]=some name how to do it in rest buffer?

example I use: http://localhost POST /users user[name]=some name

When I send it from vim rest console rails don't know how to parse request ActionDispatch::ParamsParser::ParseError (795: unexpected token at 'user[name]=some name'): but when I send request from curl it seem to be working.

What am I doing wrong?

rlisowski commented 9 years ago

Sorry I just found that header is a problem. Buffer should look like

http://localhost
Content-Type: application/x-www-form-urlencoded
POST /users
user[name]=some name

In readme there is section with post example and text [optional headers] but there are not optional for post. Content-Type: application/x-www-form-urlencoded should be default for post or section in readme should be fixed. Anyway I'm closing this issue.

Have a nice day.