Search code examples
intellij-ideaphpstorm

PhpStorm HTTP client


PhpStorm has built-in HTTP Client (https://www.jetbrains.com/help/phpstorm/http-client-in-product-code-editor.html), with JS support, which allows for writing tests. This is really handy, but would be even better, if we had a way to run those tests apart from PhpStorm, in CI environment or in console.

Is the any way to run them separately, or any script/library than accepts same syntax?


Solution

  • It is possible now.

    I just built an open-source CLI application that support execute your existing http request files.

    You can download the tool from: https://github.com/quangson91/intellij_rest_cli

    Usage:

    java -jar /path/to/restcli-1.0.jar -e "test" -s get-requests.http
    

    This tool support:

    • Execute Intellij HTTP request files.
    • Running test script inside request files.
    • Loading and inject environment variables from
      • http-client.env.json
      • http-client.private.env.json
    • Cross platform: Windows, macOS, and Linux ready.
    • Generate test report - JUnit format. 🥰🥰🥰 So you can show test report in the CI system.

    demo show test report on CI system