Closed radvil closed 8 months ago
Oh woops, I think it is a problem with the implementation. Currently it works with a path relative to where Neovim was opened, Does it work for you if your current working directory is where your files are?
I didn't notice that error because I have an autocommand that modifies my cwd in Neovim, thanks for reporting it 😅
Oh woops, I think it is a problem with the implementation. Currently it works with a path relative to where Neovim was opened, Does it work for you if your current working directory is where your files are?
I didn't notice that error because I have an autocommand that modifies my cwd in Neovim, thanks for reporting it 😅
Humm, I try to cd into the file's cwd and opened the http
file and it's still happen, the output vim.loop.cwd()
of shows that I am at the file's directory already. Did I do it wrong ?
That's odd. Does it happen if you try to manually load the environment variables file with :lua require("rest-nvim.parser.env_vars").read_file(false)
? If the function ran without errors you can check if the variable is loaded by using :=vim.env.BASE_URL_V3
and it shouldn't return nil
That's odd. Does it happen if you try to manually load the environment variables file with
:lua require("rest-nvim.parser.env_vars").read_file(false)
? If the function ran without errors you can check if the variable is loaded by using:=vim.env.BASE_URL_V3
and it shouldn't returnnil
Oh yeah, running the command manually inside the http file dir seems to works just fine, but seems like it doesn't read my Authorization header (still with the same setup as above). Following is the output when I go the next pane (Headers)
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Date: Tue, 19 Mar 2024 15:59:12 GMT
Server: openresty
Cache-Control: public, max-age=300
X-Cache: Error from cloudfront
Via: 1.1 7aabf4a3a1d35735380ea2b24910ae5e.cloudfront.net (CloudFront)
X-Amz-Cf-Pop: CGK51-P3
Alt-Svc: h3=":443"; ma=86400
X-Amz-Cf-Id: GQ5f0rbNyYLuKaJEXKm1L9gwjrQ6JTWtIn5jrKqHC3_oTPmPdtFc3Q==
Vary: Origin
And following is the response I got by running the same file:
GET https://api.themoviedb.org/3/movie/popular?language=en-US&page=1
HTTP/1.1 401 Unauthorized
#+RES
{
"status_code": 7,
"status_message": "Invalid API key: You must be granted a valid key.",
"success": false
}
#+END
The Authorization Header seems missing, IDK whether it was me who did it wrong ??
Oh yeah, running the command manually inside the http file dir seems to works just fine
Oh yes, I just found a small bug in the last refactor I did regarding the handling of .env
, I'm pushing it now :)
The Authorization Header seems missing, IDK whether it was me who did it wrong ??
I think in the rewrite I forgot to add support for authentication (which didn't exist in v1 either, perhaps that's why it didn't was in my list), but I'm already reading the lua-curl
code to add support for it, it shouldn't take me long.
Edit: could you please open a separate issue for the Authentication issues? That way it would be more organized and I can keep track of everything 🙂
yeah sure, this safe to close rn.
Mine only worked when i put quotes around it, Why?
Here is my ENV config located in the same directory as the
*.http
file that ran this commandAnd following is the request