HTTP Request in JetBrains IDEs

Artem Diashkin
Apr 11 · 4 min read

Let’s take a look at the HTTP client that can execute HTTP Requests directly in the JetBrains IDEs.

Creating HTTP/REST file

You can create HTTP/REST files inside your project. Those files will be shared between your teammates, so they could make your pre-defined requests.

Or even BE guys could create and test those files for you 🙂

After creating a new file you can define a simple GET request:

⚠️ NOTE: Each file can contain multiple requests, and you can create as many files as needed.

Scratch files

If you don’t want those HTTP files in your project, you can create a scratch file that will be stored locally and visible only for you (VCS will not manage those too)

Scratch files are included only in your local environment:

Responses log

When you run your requests, IDE will store all response data in your logs with timestamps:

If you don’t want to log your request/response you can disable it by adding @no-log comment above the request:

Converting Scratch file to the local file

If you created a scratch file but after some time you would like to move those to your project → you can easily move a scratch file to the project by pressing F6 key:

Headers

You can add any additional data you like to your requests:

Sending JSON

You can define a JSON data you want to send:

Sending files

And you can send files to the server easily:

I hope now you will stop using third-party applications if you are using WebStorm or any other JetBrains IDEs. Happy coding 🙂

Using env variables

If you have multiple environments, you can create regular or private env files that will store keys, tokens, host paths, etc…

After selecting Regular or Private file IDE will create a JSON file near your HTTP file:

Example of a created JSON file:

Now you can use variables from your JSON env file in your HTTP files…

…and run your request with the required env data:

Checking response headers, body, and content type

You can even create your own tests for endpoint responses. You can check for required properties, add your own documentation, etc…

LITSLINK

LITSLINK’s team is sharing their experience

Sign up for LITSLINK Newsletter

By LITSLINK

It's a test newsletter! Take a look.

By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy practices.

Check your inbox
Medium sent you an email at to complete your subscription.

Artem Diashkin

Written by

Java, Spring, Node.js, AdonisJs, React.js and Flutter developer

LITSLINK

LITSLINK

Hands-on up to date experience sharing of the most skilled & talented software developers right here, right now. Subscribe to learn & understand more about the Software World.

Artem Diashkin

Written by

Java, Spring, Node.js, AdonisJs, React.js and Flutter developer

LITSLINK

LITSLINK

Hands-on up to date experience sharing of the most skilled & talented software developers right here, right now. Subscribe to learn & understand more about the Software World.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface.

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox.

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic.

Get the Medium app