-
Notifications
You must be signed in to change notification settings - Fork 441
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
JavaScript code evaluation #521
Comments
Yeah this would be really good. Postman's ability to run scripts pre-request is handy for doing simple things like setting dates in the future. I guess there is a slightly elaborate workaround for this in REST client. You could run a local server which executes your script and responds in json which the REST client file can extract the variables from? |
I am about to migrate from Postman. This is the only feature missing. I don't think running a local server would convince my team. |
I need to apply encription / decryption for all requests, so pre&post JS processing would be awesome! |
It would be POSTMAN-killer feature! |
Yeah I would also like to have some scripting abilities. |
At least, some more complex variable processing to cover most of cases: like replacing only a substring of a variable, things like that. Some "templating" abilities can be enough. |
It would be handy, for JSON, to have a |
I am looking for this feature then arrived here. It would be handy. Add custom-filter or hooks during req & res duration. |
Yes, it would!! Ideally, integrated in the rest client output pane. Or a way to integrate or "pipe" to existing vscode jq extensions such as jq-vscode or VSCode jq playground. Maybe we're not that far from such an integration: VSCode jq playground is already able to apply jq filters to any opened file or unsaved buffer, specified by its path or name. But it seems the rest client output pane is a different object which VSCode jq playground does not recognize: it looks like we'd just need an option in the rest client to send the json part of the rest call response to a given file. |
First of all, love this extension, I was searching some solution for code blocks in the extension, I just want to throw some ideas, maybe helpful or not. Is it possible for variable resolution, using IIFE style ( similar to other ****Monkey chrome extensions) to wrap up user's custom code block? e.g. (function (param) {
'use strict';
/*
* user custom code block goes here
*/
return param + '->output';
})('input'); The similar feature in postman |
on the home page for this extension it says "Generate code snippets for HTTP request in languages like Python, JavaScript and more" but have not seen any examples or documentation around this feature |
That is a feature that turns your request in to code that sends the same request.. If you do the "Rest Client: Generate code snippet" action you'll see what it does. |
I had an idea on this... What if we treated code blocks similarly to request blocks? You give them a name, they are executed linearly top-to-bottom, with the stdout cached -- and if it can be parsed as JSON then you can treat it as JSON when referencing it later on. We could even have some double-meaning with the language annotation:
Example
|
Any updates on this ? like running pre and post js code |
@piyushchauhan2011, you can take a look at httpyac. I switched to that quite a while ago. It's more actively maintained and has more features. https://github.com/AnWeber/httpyac |
Thanks for the links @asampal . Hope restclient also add similar features, but httpyac seems to have good progress at present moment |
It'd be nice to have the option of including JS code snippets to be resolved when sending the request
The text was updated successfully, but these errors were encountered: