Prince
Prince

Reputation: 59

Send request not showing in rest client

I have installed rest client extension in VScode, but when I create .rest file and make some requests I don’t see the send request link

### 
GET http://localhost:3000/signin

Upvotes: 4

Views: 4217

Answers (7)

Wazi
Wazi

Reputation: 11

Tried most things but this actually worked.

Have the file open or selected and go to File > Preferences > Settings > Extensions > REST Client Then click "Edit in settings.json" and add the following.

{
    "editor.codeLens": true
}

Upvotes: 0

rsapru
rsapru

Reputation: 698

Had the same issue, Put the cursor on the REST Call and press CTL+ALT+R combination to execute the call.

Upvotes: 0

PKKid
PKKid

Reputation: 3076

I had the following in my settings which hides the "Send Request" button. Commenting this out brings the button back.

{
  "editor.codeLens": false
}

Upvotes: 3

user25361444
user25361444

Reputation: 1

I had the same problem. This is how I fixed it:

  1. Installed "REST Client by HuaChao Mao" -> Open Visual Studio Code -> Extensions -> In the search bar, type "Rest client" -> Install.

Rest Client

  1. Created an HTTP file -> Right-click on your folder, select New File -> name the file with an HTTP extension, for example "requests.http" -> Save.

  2. Type GET and you will see the "Send Request" button appear.

Sample GET request

Troubleshooting:

  1. If the Send Request button does not show up, try running the Program.cs. It should say:"Now Listening on: HTTP://localhost:####", where #### is your port number.

ListeningPort

  1. Check the debug console for exceptions.
  2. All else fails, uninstall the Rest Client and reinstall.

Hope this helps.

Upvotes: 0

IK.
IK.

Reputation: 645

Not sure if this what you are looking for, but if you would like to see your request displayed in the same window as response, you need to add the following configuration to your settings.json file:

    "rest-client.previewOption":"exchange"

This is covered in "Customize Response Preview" section of the help page

Upvotes: 1

PotatoesMaster
PotatoesMaster

Reputation: 183

You can view the request details by opening the request history and selecting the first entry.

Press Ctrl + Alt + H to open the request history (or run 'Rest Client: View Request History' from the command palette).

Reference: https://github.com/Huachao/vscode-restclient#request-history

Upvotes: 1

BienCao-NamViet
BienCao-NamViet

Reputation: 29

You can add three # symbol after each request like below:

POST http://localhost:8800/api/carts/ Content-Type: application/json; charset=utf-8

{ "productId": "63c00763e65ebde449e9b411", "quantity": "1" }

3 '###' here

GET http://localhost:8800/api/carts/

Upvotes: 2

Related Questions