Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use content-type:, other casing doesn't work #157

Closed
xbladesub opened this issue Dec 2, 2022 · 12 comments · Fixed by #170 or #264
Closed

use content-type:, other casing doesn't work #157

xbladesub opened this issue Dec 2, 2022 · 12 comments · Fixed by #170 or #264

Comments

@xbladesub
Copy link

I used rest.nvim couple of weeks ago and everything was fine. However it doesn't work anymore and I have no idea why.

This is my request:

POST http://127.0.0.1:8080/v1/user/signup
Content-Type: application/json
API-TOKEN: API-TOKEN: 0a479179624fb5255cb9054603382077dd7366b0319386dd89b12806463bd000

{
  "device_id": "admin_1",
  "password": "admin_1"
}

I use Rust - actix-web framework. It says Error in response: Deserialize(Error("expected value", line: 1, column: 1))

Btw, everything is okay in Insomnia and Postman

@jungai
Copy link

jungai commented Dec 3, 2022

Same issue

@Emptyfruit
Copy link

Can be related to #114 because I got this issue after installing today for the first time.

@sjdonado
Copy link

sjdonado commented Dec 6, 2022

Same here. This project seems to be a bit abandoned :(

@rhinoxi
Copy link

rhinoxi commented Dec 8, 2022

I think this is related to the PR #142 in this thread #141 (comment), which makes "Content-Type: application/json" couldn't be recognized and the brace around the raw body will be removed when calling curl.

@MikaelElkiaer
Copy link

Same here. This project seems to be a bit abandoned :(

It does seem abandoned.

If you see the branch document-competition there is an alternative Hurl that seems a lot more mature, although it is not specifically for Neovim.
There is also a tree-sitter grammar and you could probably use something like flow.nvim to execute - combining the two and you could do a visual via tree-sitter and run with flow.

@sharksforarms
Copy link

for those looking for a quick work-around, replace Content-Type with content-type

@teto
Copy link
Collaborator

teto commented Dec 20, 2022

If you see the branch document-competition

That branch got merged hence the "competition" appears at https://github.com/rest-nvim/rest.nvim#related-software .
I am trying to add testing to prevent this kind of regression but any help welcome ofc

@MikaelElkiaer
Copy link

If you see the branch document-competition

That branch got merged hence the "competition" appears at https://github.com/rest-nvim/rest.nvim#related-software . I am trying to add testing to prevent this kind of regression but any help welcome ofc

Did you consider utilizing Hurl as a request engine, instead of the current one?
This would offer a lot more, and possibly more stable, features - and still get the benefits of the Neovim integration.

@rochacbruno
Copy link
Contributor

for those looking for a quick work-around, replace Content-Type with content-type

This is what works for me!

@teto teto changed the title Doesn't work anymore some reason use content-type:, other casing doesn't work Dec 23, 2022
@teto teto pinned this issue Dec 23, 2022
@teto
Copy link
Collaborator

teto commented Dec 28, 2022

Did you consider utilizing Hurl as a request engine, instead of the current one?

I am testing hurl at the moment but note that I am not the creator of the plugin. I just added 2/3 commits to fix issues as I use this plugin in my work. I prefer to keep the work to a minimum though I would be curious to experiment with teal for this plugin.

This would offer a lot more, and possibly more stable, features - and still get the benefits of the Neovim integration.

The benefits of neovim integration is to be able to run inline lua code as done #122. Not something that hurl can do. I would be curious in your feedback running hurl-based request with flow.nvim. For me the real issue is the absence of testing, once this is fixed (and I've done mmuch progress if you look at main in that regard), we should be much better off. This issue is my current priority.

@teto teto mentioned this issue Dec 29, 2022
@rochacbruno
Copy link
Contributor

I was thinking about a hurl plugin for neovim but I don´t like the fact that hurl runs the whole file and I want to be able to have a single .http file for a feature/project and run each request individually.

Also, hurl introduces too much syntax that is not exactly pure HTTP, the best thing in rest-nvim is that it is a pure http request format.

teto added a commit to teto/rest.nvim that referenced this issue Dec 29, 2022
we special case json when checking the payload body via
encoding/decoding it.
This is done by checking the "content-type" in:
rest-nvim#157

There doesn't seem to be a need for that other than possibly validate
the payload ? in which case we should implement something more generic.
@teto teto closed this as completed in #170 Dec 30, 2022
@teto
Copy link
Collaborator

teto commented May 11, 2023

@rochacbruno I haven't upgraded my fork of #174 in a long time. Right now I am testing hurl. I've opened #195 in case you are interested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
9 participants