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

Python3 Error not able to use it. #2

Open
amittalande opened this issue Oct 11, 2023 · 2 comments
Open

Python3 Error not able to use it. #2

amittalande opened this issue Oct 11, 2023 · 2 comments
Labels
question Further information is requested

Comments

@amittalande
Copy link

Hi Fabio,

I am getting following error while executing :http command. I tried to google it but could not get any solution.
Could you please guid me, so I can use nvim-http. Thanks for wonderful plugins.

Error invoking 'python_execute' on channel 35 (python3-script-host):
Traceback (most recent call last):
File "", line 1, in
File "/Users/xxx/.local/share/nvim/lazy/nvim-http/autoload/../python/nvim_http/client.py", line 63, in http_run
request = parse_http_request(text, **env)
File "/Users/xxx/.local/share/nvim/lazy/nvim-http/autoload/../python/nvim_http/parser.py", line 24, in parse_http_request
assert m, f"Unable to parse the request line: {line}"
AssertionError: Unable to parse the request line:
2023-10-12T02:03:14 Error  ERROR Error detected while processing function http#Run[1]..provider#python3#Call:

@dafeder
Copy link

dafeder commented Nov 29, 2023

Same

@blacklight
Copy link
Owner

Hi @amittalande, sorry for the late reply.

Could you paste the request file that you're trying to execute, and also where the cursor is in the file when the request is being run?

If you get this error:

 AssertionError: Unable to parse the request line:

With no string after the parse the request line: part it means that you are probably trying to send a request from an invalid block of text.

You can try with a request buffer like this:

###
POST http://localhost:8080/endpoint
Authorization: Bearer {{jwt_token}}
Accept: application/json
Content-Type: application/json

{
  "foo": "bar"
}

With # or ### as a request separator. Then place the cursor anywhere inside of the request body and type :Http. Does it work in this case?

@blacklight blacklight added the question Further information is requested label Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants