Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 09:04
  • 08:40
  • 07:04
    appsplash99 starred Huachao/vscode-restclient
  • 06:46
    bartsimp closed #815
  • 06:46
    bartsimp commented #815
  • 00:07
    dfrankland starred Huachao/vscode-restclient
  • Apr 13 23:21
  • Apr 13 20:06
    erlethor edited #819
  • Apr 13 20:04
    erlethor edited #819
  • Apr 13 20:04
    erlethor opened #819
  • Apr 13 19:01
    SjaaLom edited #818
  • Apr 13 18:59
    SjaaLom opened #818
  • Apr 13 15:32
    pa-ulander commented #815
  • Apr 13 14:51
    adibradfield commented #816
  • Apr 13 14:48
    adibradfield commented #816
  • Apr 13 14:48
    adibradfield commented #816
  • Apr 13 12:43
    JulienDecottignies edited #817
  • Apr 13 12:43
    JulienDecottignies opened #817
  • Apr 13 11:18
    pa-ulander commented #815
  • Apr 13 08:07
    zhupengfeivip commented #646
Huachao Mao
@Huachao
@jasonelston could you please show me your request in the file
Jason Elston
@jasonelston

@Huachao
First request (from ~/.rest-client/history.json)

{
  "method": "POST",
  "url": "http://auth.domain.local:5555/v2/login",
  "headers": {
    "Content-Type": "application/json",
    "User-Agent": "vscode-restclient"
  },
  "body": "{\n  \"email\": \"redacted\",\n  \"password\": \"123456\"\n}",
  "startTime": 1582971415788
}

First response

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Set-Cookie: domainCookie.local=<redacted>; Path=/; Domain=domain.local; Expires=Mon, 30 Mar 2020 10:22:39 GMT; HttpOnly
Date: Sat, 29 Feb 2020 10:22:39 GMT
Content-Length: 295
Connection: close

{
  "user": {
    <redacted>
  }
}

Second request

{
  "method": "POST",
  "url": "http://api.domain.local:8000/v1/<redacted>",
  "headers": {
    "Content-Type": "application/json",
    "User-Agent": "vscode-restclient"
  },
  "body": "<redacted>",
  "startTime": 1582971426667
}

Second response

HTTP/1.1 401 Unauthorized
Content-Type: text/plain; charset=utf-8
X-Content-Type-Options: nosniff
Date: Sat, 29 Feb 2020 10:28:29 GMT
Content-Length: 36
Connection: close

please login to perform this action
Jason Elston
@jasonelston
For reference, I'm running rest-client version 0.23.1 now and have left the default of sending cookies enabled.
Huachao Mao
@Huachao
@jasonelston I have found the root cause that breaks the cookiejar stores your cookie, since your domain domain.local violates the Public Suffix Rule. Postman can work since it explicits sets the property to false, https://github.com/postmanlabs/postman-sandbox/blob/299ea4603f2db6f566ac186a0a5336f209a75976/lib/sandbox/cookie-jar.js#L174
Huachao Mao
@Huachao
@jasonelston I have fixed in commit Huachao/vscode-restclient@0264470
Jason Elston
@jasonelston
Fantastic, thanks @Huachao I'll install the branch and give it a go. Any ideas on when that will be included in a release?
Huachao Mao
@Huachao
@jasonelston you can try this in the latest version 0.23.2
Pavel Voronin
@pavel-voronin
Hi! I need help. Do you know how to send POST body with new lines? Like this:
# @name post_scenario
POST /{{version}}/users/1/scenario HTTP/1.1
Host: {{host}}
Content-Type: text/plain
Authorization: Bearer {{accessToken}}

make-booking-link:
  type: api
  call: makeBooking
  next: working-hours, not-working-hours

working-hours:
  type: in
  hours: working
  next: we-are-open
REST client forces me to remove empty lines (
Valentin Marin
@valentinmarinro
Hi @Huachao , it is possible to run javascript code, for example calling the CryptoJS library?
Huachao Mao
@Huachao
@valentinmarinro it's still impossible, and issue Huachao/vscode-restclient#521 is tracking this.
Valentin Marin
@valentinmarinro
@Huachao thank you, for answer, some estimation when / if it will be implemented, we would like to move from Postman to RESTClient
Huachao Mao
@Huachao
@pavel-voronin I have fixed this issue and will publish it in the next release
Mike Alesso
@mike-alesso
Is there currently a way to set a variable that can be shared between files? I know the shared environment file exists but for many use cases it is nice to be able to run a command in one file and set a variable for use in other files.
guidoPaglie
@guidoPaglie
@mike-alesso do you have any news about this ?
Kristjan Adojaan
@adojaan
Hi! Is it possible to send curl requests to non-standard port? I have to make curl request to https://address.com:3102/api/ but all I get is Parse Error: Expected HTTP/
It works well in my VSCODE without specifying port.
Huachao Mao
@Huachao
@adojaan can you show me your curl request that executed in my extension?
Kristjan Adojaan
@adojaan
Hi @Huachao . Non-working request is
https://test.excellent.ee:3102/api/1/CUVc
"Send request" link is displayed and when I click it Parse Error: Expected HTTP/ is displayed. It does not complain, when I remove port number from the request (but obviously does not work as there is no service and it times out after some time). Your extension works well with another. The sample request should actually return nothing (without authorization), but it does not work with authorization either. The error is the same when my Request is
https://test.excellent.ee:3102/api/1/CUVc
Authorization: Basic **:**
(username and password hidden)
When using command line curl specifying -u**:* it works well.
Kristjan Adojaan
@adojaan
image.png
The request in the middle works well. Even when I add standard port :80 to the address.
Huachao Mao
@Huachao
@adojaan nice catch, the root cause is that the response sent from the server is malformed which causes Node.js throws a Parser Error when parsing the response. And the underlying HTTP client library built on Node.js called got that we use, will raise the error .
Kristjan Adojaan
@adojaan
image.png
Thank you but... ummm... will you do something about it or I have to change my query? Or we can do nothing as the server is out of my hands? I know, that it works well with command line curl (when authorized). Without authorization it returns 401. The only thing I notice with authorized request that it does not have newline at the end.
I can, of course, try to pass the information to the owner of the API, if you describe what is malformed in the request.
Huachao Mao
@Huachao
@adojaan thanks for your quick response, could you please provide the verbose info from curl in both cases(w/o Authorization header)? Thanks in advance.
Huachao Mao
@Huachao
@adojaan it seems related to the request header "accept-encoding": "gzip, deflate", maybe server didn't handle well for gzip response
bboh
@bboh
Hi, I am wondering if there is an intended way to run request files outside of an editor (cli or programmatically)? my use case is running them in a CI pipeline
Huachao Mao
@Huachao
@bboh No, currently it's not supported
douhaolee
@douhaolee
Hi, I set "rest-client.logLevel": "verbose", but still not found any logs under output for REST -- anyone knows about it?
Andy
@AndyBullivent

Hi - I'm attempting to hit a port on localhost with a call in VS code. My app's code in full fat VS can hit it, my browser can hit it, but VS rest client seems to have trouble. Probably my own fault somewhere, but thought I'd check here. It simply says

Connection is being rejected. The service isn’t running on the server, or incorrect proxy settings in vscode, or a firewall is blocking requests. Details: RequestError: connect ECONNREFUSED 127.0.0.1:9200.

Also - when I do successfully make a call elsewhere - I can select part of the response body in the response pane, copy and paste, but only once! After that, even after restarts and re-installs of the rest client, it won't allow me to do it again. Thought it was me, but it's done it over 2 different machines now!
benjaminclewis
@benjaminclewis
Is it possible to use authorization code flow with PKCE using this client? I'm not sure how to handle response/popup from /authorize endpoint.
Jeremy West
@jwest80
I use a host file entry with IP address and host to another pc on local network. This works in postman, but gives me a DNS error in Rest-Client. Does Rest-Client respect host file entries?
Huachao Mao
@Huachao
@jwest80 it should respect
Jeremy West
@jwest80
Thanks for the response. I set bindings in IIS to IP Address as a work around. The host file entry works in browser/Postman ect... Not sure what is wrong then.
I can also ping using the address in host file from terminal in vscode.
Jeremy West
@jwest80
@Huachao I solved my issue by running VS Code as administrator. The hosts file was readable by Everyone. I will update if I learn more, but the issue is clearly on my box.
tomvjoss
@tomvjoss
trying to post mesage with custom headers. but rest client not sending custom headers are.
how can i send custom header in post message
Constantinos Christoforou
@constantinoschristoforou
Hello,
Is there a way to share a dynamic variable across files?
I want to store the jwt token in a variable and have access to it on different files.
Now i have 1 files for all of my request, but i am trying to break them in different files.
Valerii Koval
@kovalvalerii
Hello,
+1 to the question about sharing variable between files.
As an alternative option - is it possible to add 'set global var' functionality?
This would help a lot in such cases when we want to get a token and then share it between few files.
@constantinoschristoforou meanwhile I've prepared a script to get the token to a ".env" file and use that file in the http files:
'@authToken = {{$dotenv authToken}}'
Peter Wippermann
@PeterWippermann
Hi,
I stumbled across the annotations @skip and @status. Are those officially available and documented?
Peter Wippermann
@PeterWippermann

Hi,
I stumbled across the annotations @skip and @status. Are those officially available and documented?

In my case these seem to be used as "Per-request Settings". But only note is officially documented: https://github.com/Huachao/vscode-restclient#per-request-settings

Pavel Yudin
@pashkatrick
Hi! can anyone share me an example with "Send request" button like implementing in my vscode extension? pure js is favorite )) i'll see your sources, but ts... search for basics )
KKR33
@KKR33
Hi Huachao, for me curl is working fine but not rest client on localhost

POST http://localhost:8080/oauth/token HTTP/1.1

Content-Type: application/x-www-form-urlencoded

client_id=client1
&client_secret=bla
&grant_type=client_credentials
&scope=read

curl -X POST -u "client1:bla" -d "grant_type=client_credentials" http://localhost:8080/oauth/token
I am on vdi, not sure if that makes any difference
Peter Wippermann
@PeterWippermann

Hi,
I stumbled across the annotations @skip and @status. Are those officially available and documented?

These are custom annotations only available in a private fork. They are not part of the officially available vscode-restclient

davidjwip
@davidjwip
Hi folks - just came across this extension. Wondering if anyone has managed to get this to work with smart card certificates?