Huachao / vscode-restclient

REST Client Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=humao.rest-client
MIT License
5.21k stars 433 forks source link

Executing the saved .http files on another tool #882

Open lalberto8085 opened 3 years ago

lalberto8085 commented 3 years ago

I know this might be a little off topic, but I have created several files to manually test some API and would like to now use those same files to run automated tests.

Are there any tools I can use for this?

Thanks in advance

asmith3006 commented 3 years ago

I don't know a way to do this in this extension (that's not really what it's for).

If you right click the request (one at a time) you can "Generate Code" which can give you powershell snippets. You can then copy / paste these into a ps1 to make an automated test.

AnWeber commented 3 years ago

you could try using https://httpyac.github.io/. It provides a cli tool, which is compatible with rest-client.

api1st commented 2 years ago

https://github.com/api1st/httprun is a Windows/Linux command-line tool for executing the .http files that vscode-restclient uses.

mindaugasw commented 5 months ago

There's also HTTP Client CLI from JetBrains, which supports the same format.

Here's the command I use to run requests from CLI:

docker run --rm -t -v \
        .:/workdir \
        --network=my_project_network \
        jetbrains/intellij-http-client \
        requests.rest

You need to add a named docker-compose network for this to work:

networks:
    default:
        name: my_project_network