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

Request body in JSON file not working with relative or absolute path #1248

Open
devklick opened this issue Mar 2, 2024 · 1 comment
Open

Comments

@devklick
Copy link

devklick commented Mar 2, 2024

  • REST Client Version:v0.25.1
  • VSCode Version: 1.87.0
  • OS Version: Linux Mint 21.1

When I specify a path to a JSON file to use as the request body and send the request, nothing happens. I see no response indicating an error, I see nothing produces in the REST client output logs - it just seems like nothing happens.

Steps to Reproduce:

  1. Create a .json file with JSON content to use as the request body, e.g. ./test-data.json, example contents:
{
    "name": "example-name"
}
  1. Add a call to an endpoint and pass in this file as the request body, e.g.
POST localhost:1234/test/endpoint
Accept: application/json
Content-Type: application/json

< ./test-data.json
  1. Call endpoint

I have tried using both absolute path and relative path to the rile and experience the same problem in each case.

I notice that the (docs)[https://github.com/Huachao/vscode-restclient?tab=readme-ov-file#request-body] example only uses an XML file, and doesnt specify that only XML is supported, or that multiple file types are supported, so I expect that a JSON file should work. But maybe this is not the case?

@devklick
Copy link
Author

devklick commented Mar 7, 2024

It looks like the request actually is being sent, as when making the request when against an invalid target API I get a toaster error pop up:

The connection was rejected. Either the requested service isn’t running on the requested server/port, the proxy settings in vscode are misconfigured, or a firewall is blocking requests. Details: RequestError: connect ECONNREFUSED 127.0.0.1:5264.

However when the target API is available and I make the request, I dont see any REST client logs and I dont get a response panel open up.

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

No branches or pull requests

1 participant