Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
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?
Don Khan
@donatwork
Hello, I'm running into that error "(command 'rest-client.request' not found)" again. I did the usual uninstall/reinstall and manual install and not able to resolve. Even uninstalled/reinstalled VS Code. This was working fine for a while, I recently updated my VS Code to 1.56.2. I'll try to see if I can download an older version of VS Code to try my theory. Has anyone got this working with the latest VS Code build, 1.56.2. REST Client 0.24.5. Is there some thing I can do to trace this?
Don Khan
@donatwork
Never mind. I ended up deleting my ~/.rest-client directory and restarted VS Code and things are back to normal. I saw referenced to this directory in an earlier thread and decided to give it a try. Problem solved.
Jeremy Kuhnash
@jeremykuhnash
Any thoughts on a small project to execute HTTP files via command line?
Dwayne
@dremekie
@jeremykuhnash I've been using httpyac which is very much like rest-client but it includes a very flexible command line interface. Very very good. https://github.com/AnWeber/httpyac
Jeremy Kuhnash
@jeremykuhnash
Thank you dwayne!
bonn
@zhupengfeivip
@Huachao 大佬你好,配置文件是否支持和*.http 在同一个目录?
我翻了目前的文档 ,没有找到资料,好像不支持这个,是吗