diepm / vim-rest-console

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

multipart/form-data Requires cUrl Flags #85

Open aoswalt opened 4 years ago

aoswalt commented 4 years ago

When sending a multipart/form-data request, listing the parameters as with a application/x-www-form-urlencoded request does not work.

With the global section

https://api.todoist.com/sync/v8

token = my_token
project_id = 12345
--

Works as expected

--
Content-Type: application/x-www-form-urlencoded

POST /templates/export_as_file
token=:token&
project_id=:project_id

API errors saying an argument is missing

--
Content-Type: multipart/form-data

POST /templates/import_into_project
token=:token&
project_id=:project_id
file=@project.csv

Works as expected (after replacing the variables with their values)

--
Content-Type: multipart/form-data

-F token=:token
-F project_id=:project_id
-F file=@project.csv

POST /templates/import_into_project
diepm commented 4 years ago

Is the argument missing error due to the missing & after :project_id?

aoswalt commented 4 years ago

Unfortunately not. I had tried it both ways and mistakenly copied the one without the &, but the result is the same.