# HTTP Client

With the HTTP Client plugin, you can create, edit, and execute HTTP requests directly in the IntelliJ IDEA  [code editor](using-code-editor.html).

![Example HTTP request](https://resources.jetbrains.com.cn/help/img/idea/2026.2/basic_request.animated.gif)

There are two main use cases when you need to compose and run HTTP requests:

* When you are developing a RESTful web service and want to make sure it works as expected, is accessible in compliance with the specification, and responds correctly.

* When you are developing an application that addresses a RESTful web service. In this case, it is helpful to investigate the access to the service and the required input data before you start the development. During development, you may also call this web service from outside your application. This may help locate errors when your application results in unexpected output while no logical errors are detected in your code, and you suspect that the bottleneck is the interaction with the web service.

HTTP requests are stored in `.http` and `.rest` files and are marked with the ![HTTP file icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/restClient.com.intellij.ws.rest.client.icons.expui.httpRequestsFiletype.svg) icon.

Support for HTTP files includes the following features:

* [Code highlighting](configuring-colors-and-fonts.html)

* [Code completion](auto-completing-code.html) for hosts, method types, header fields, and endpoints defined via [OpenAPI](openapi.html)

* [Code folding](working-with-source-code.html#code_folding) for requests, their parts, and response handler scripts

* [Reformat](reformat-and-rearrange-code.html) requests according to your HTTP Request code style.

* [Inline documentation](viewing-reference-information.html) for request header fields and doc tags

* [Viewing the structure](#structure-tool-window) of HTTP request files

* [Language injections in Web languages](using-language-injections.html) inside the request message body

* [Move refactorings](move-refactorings.html)

* [Live templates](using-live-templates.html)

If necessary, before you begin, configure the Proxy settings on the [HTTP Proxy](settings-http-proxy.html) page   of the Settings dialog (`Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS))).

## Create HTTP request files

You can work with HTTP requests either from scratch files or from physical files of the HTTP Request type. Each file can contain multiple requests, and you can create as many files as needed.

[Scratch files](scratches.html) can be used to test HTTP requests during development. Scratch files are not stored inside a project, so IntelliJ IDEA can modify them and add additional information about the request. When an HTTP request is executed from a scratch file, the link to the response output file is added below the request and at the top of the [requests history](#requests_history) file.

Procedure: Create an HTTP request scratch file

* Press `Ctrl+Alt+Shift+Insert` (Windows), `⌘ ⇧ N` (macOS), `⌃ ⇧ N` (IntelliJ IDEA Classic (macOS)), `⌃ ⇧ N` (macOS System Shortcuts), `Ctrl+Alt+Shift+Insert` (XWin), `Ctrl+Alt+Shift+Insert` (GNOME), `Ctrl+Alt+Shift+Insert` (KDE), `Ctrl+Alt+Shift+Insert` (Emacs), `Ctrl+Alt+Shift+Insert` (Sublime Text), `⌘ ⇧ N` (Sublime Text (macOS)), `Ctrl+Alt+Shift+Insert` (NetBeans), `Ctrl+Alt+Shift+Insert` (Visual Studio), `⌘ ⇧ N` (Visual Studio (macOS)), `Ctrl+Alt+Shift+Insert` (Eclipse), `⌘ ⇧ N` (Eclipse (macOS)) and select HTTP Request.

Physical files can be used for documenting, testing, and validating HTTP requests. Physical files are stored inside your project, and IntelliJ IDEA will not modify them. When an HTTP request is executed from a physical file, this file is not modified. Information about the executed request with the link to the response output file is added to the top of the [requests history](#requests_history) file.

Procedure: Create a physical HTTP request file

* In the File menu, point to New, and then click HTTP Request .

Procedure: Move an HTTP request

You can use the [Move](move-refactorings.html) refactoring `F6` (Windows), `F6` (macOS), `F6` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ I` (macOS System Shortcuts), `F6` (XWin), `F6` (GNOME), `F6` (KDE), `F6` (Emacs), `F6` (Sublime Text), `F6` (Sublime Text (macOS)), `Ctrl+M` (NetBeans), `Ctrl+R, O` (Visual Studio), `⌘ R, O` (Visual Studio (macOS)), `Alt+Shift+V` (Eclipse), `⌘ ⌥ V` (Eclipse (macOS)) to move HTTP requests from scratches to physical files, as well as between physical files.

1. In the editor, place the caret at the request to be moved and do one of the following:

* From the main menu or the context menu, select `Refactor | Move`.

* Press `Ctrl+Shift+A` (Windows), `⌘ ⇧ A` (macOS), `⌘ ⇧ A` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ P` (macOS System Shortcuts), `Ctrl+Shift+A` (XWin), `Ctrl+Shift+A` (GNOME), `Ctrl+Shift+A` (KDE), `Escape, X` (Emacs), `Ctrl+Shift+P` (Sublime Text), `⌘ ⇧ P` (Sublime Text (macOS)), `Ctrl+I` (NetBeans), `Ctrl+Shift+A` (Visual Studio), `⌘ ⇧ A` (Visual Studio (macOS)), `Ctrl+Shift+A` (Eclipse), `⌘ 3` (Eclipse (macOS)), start typing `Refactor` , then select the action from the list. In the Refactor popup that opens, select Move.

* Press `Alt+Enter` (Windows), `⌥ ⏎` (macOS), `⌥ ⏎` (IntelliJ IDEA Classic (macOS)), `⌥ ⏎` (macOS System Shortcuts), `Alt+Enter` (XWin), `Alt+Enter` (GNOME), `Alt+Enter` (KDE), `Alt+Enter` (Emacs), `Alt+Enter` (Sublime Text), `⌥ ⏎` (Sublime Text (macOS)), `Alt+Enter` (NetBeans), `Alt+Enter` (Visual Studio), `⌥ ⏎` (Visual Studio (macOS)), `Ctrl+1` (Eclipse), `⌘ 1` (Eclipse (macOS)) and select the Move HTTP Requests [intention action](intention-actions.html).

* Press `F6` (Windows), `F6` (macOS), `F6` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ I` (macOS System Shortcuts), `F6` (XWin), `F6` (GNOME), `F6` (KDE), `F6` (Emacs), `F6` (Sublime Text), `F6` (Sublime Text (macOS)), `Ctrl+M` (NetBeans), `Ctrl+R, O` (Visual Studio), `⌘ R, O` (Visual Studio (macOS)), `Alt+Shift+V` (Eclipse), `⌘ ⌥ V` (Eclipse (macOS)).

2. In the Move HTTP Requests dialog that opens, do the following:

1.

In the Path field, choose one of the existing `.http` files from the list or click ![the Browse button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.general.ellipsis.svg) to locate the file.

You can also type the full path to the file manually. If you specify the name of a non-existing file, a new file with the provided name will be created automatically.

2.  In the Requests list, select the checkboxes next to the requests you want to move.

## Compose HTTP requests

IntelliJ IDEA uses the HTTP request in Editor format, which provides a simple way to create, execute, and store information about HTTP requests. You can type them directly in the [created HTTP request files](#creating-http-request-files) using the following general syntax:

```GENERIC
###
Method Request-URI HTTP-Version
Header-field: Header-value

Request-Body
```

After the `###` separator, you can enter any comments preceded by `#` or `//`.

> **Tip:**
> To quickly find your request in run/debug configurations, Search Everywhere, and Run Anything, you can [give it a name](exploring-http-syntax.html#http_request_names).

> **Note:**
> You can use the `Editor | Color Scheme | HTTP Request` settings to [customize colors and style](configuring-colors-and-fonts.html#customize-color-scheme) for highlighting request syntax (name, comments, parameters, headers, and so on).

To speed up composing HTTP requests, you can:

* Click `Tools | HTTP Client | Create Request in HTTP Client`. If a request file is opened in the editor, this will add a request template to the opened file. Otherwise, this will create a new `.http` scratch file.

* Click ![the Add Request button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.add.svg) on top of the request's editor panel. In the popup menu, select the type of the request to add. ![Add an HTTP request](https://resources.jetbrains.com.cn/help/img/idea/2026.2/add-http-request.png)

Alternatively, use [live templates](using-live-templates.html). In the editor, you can press `Ctrl+J` (Windows), `⌘ J` (macOS), `⌘ J` (IntelliJ IDEA Classic (macOS)), `⌘ J` (macOS System Shortcuts), `Ctrl+J` (XWin), `Ctrl+J` (GNOME), `Ctrl+J` (KDE), `Ctrl+J` (Emacs), `Ctrl+J` (Sublime Text), `Ctrl+J` (Sublime Text (macOS)), `Ctrl+J` (NetBeans), `Ctrl+K, X` (Visual Studio), `⌘ E, L` (Visual Studio (macOS)), `Ctrl+Alt+Shift+J` (Eclipse), `Ctrl+J` (Eclipse (macOS)) to view the list of available templates. For example, gtr expands to a simple GET request; mptr expands to a `multipart/form-data` POST request.

![Expand post template](https://resources.jetbrains.com.cn/help/img/idea/2026.2/expand_post_template.animated.gif)

> **Tip:**
> If you use `application/x-www-form-urlencoded` content type, you should use `%` to escape `%`, `&`, `=`, and `+` special characters in the keys and values of the request body.
>
>
>
> For example, for a server to receive `field1=value%2Bvalue&field2=value%26value` (where `%2B` corresponds to `+` and `%26` corresponds to `&`), the request body should be as follows:
>
>
>
>
> ```
> POST https://ijhttp-examples.jetbrains.com/post
> Content-Type: application/x-www-form-urlencoded
>
> field1=value%+value&field2=value%&value
> ```
>
>
>
> Or you can write encoded values right away, for example `value1%ADvalue2` for `value1 value2` or `value1%2Bvalue2` for `value1+value2`.

Procedure: Create custom HTTP methods

If a web service requires you to use custom HTTP methods, you can add such methods to IntelliJ IDEA and use them in your HTTP requests.

1. In an `.http` file, type a custom method in uppercase letters.

2. When this method is highlighted as unknown, press `Alt+Enter` (Windows), `⌥ ⏎` (macOS), `⌥ ⏎` (IntelliJ IDEA Classic (macOS)), `⌥ ⏎` (macOS System Shortcuts), `Alt+Enter` (XWin), `Alt+Enter` (GNOME), `Alt+Enter` (KDE), `Alt+Enter` (Emacs), `Alt+Enter` (Sublime Text), `⌥ ⏎` (Sublime Text (macOS)), `Alt+Enter` (NetBeans), `Alt+Enter` (Visual Studio), `⌥ ⏎` (Visual Studio (macOS)), `Ctrl+1` (Eclipse), `⌘ 1` (Eclipse (macOS)) (Show Context Actions) and select Add custom HTTP method.

![Add custom HTTP method](https://resources.jetbrains.com.cn/help/img/idea/2026.2/http_client_custom_methods.png)

IntelliJ IDEA will now recognize it as a valid HTTP method. You can find all custom HTTP methods (and add new ones) in the IDE settings (`Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS))), under `Tools | HTTP Client | Custom HTTP methods`.

### HTTP/2

Starting with version 2024.1, IntelliJ IDEA provides support for HTTP/2 in HTTP requests. You can specify the HTTP version after the URL part, for example:

```HTTP_REQUEST_FULL
GET https://example.org HTTP/2
```

If no version is specified, the HTTP Client attempts to use HTTP/2 for secure connections (and falls back to HTTP/1.1 if HTTP/2 negotiation fails) and HTTP/1.1 for non-secure connections.

Procedure: Select HTTP version

1. After the request URL, put a white space and press `Ctrl+Space` (Windows), `⌃ Space` (macOS), `⌃ Space` (IntelliJ IDEA Classic (macOS)), `⌃ Space` (macOS System Shortcuts), `Ctrl+Space` (XWin), `Ctrl+Space` (GNOME), `Ctrl+Space` (KDE), `Alt+/` (Emacs), `Ctrl+Space` (Sublime Text), `⌃ Space` (Sublime Text (macOS)), `Ctrl+Space` (NetBeans), `Ctrl+Space` (Visual Studio), `⌃ Space` (Visual Studio (macOS)), `Ctrl+Space` (Eclipse), `⌃ Space` (Eclipse (macOS)) or start typing `HTTP`.

2. From the completion list, select one of the suggested values:

* `HTTP/1.1` to enforce the use of HTTP/1.1.

* `HTTP/2` to enable the use of HTTP/2.

* `HTTP/2 (Prior Knowledge)` to send using HTTP/2 without HTTP/1.1 Upgrade. Use it if you know your server can handle HTTP/2 connections.

![Enable HTTP/2](https://resources.jetbrains.com.cn/help/img/idea/2026.2/http_client_enable_http_version_two.png)

To get an overview of the HTTP Client features, you can explore the HTTP Requests Collection, which is a handful selection of composed requests.

Procedure: Open a request from the HTTP Requests Collection

1. Click the Examples shortcut link on top of the request's editor panel.

2. In the popup menu, choose the HTTP Requests collection you wish to open:

![Open HTTP Requests Collection popup](https://resources.jetbrains.com.cn/help/img/idea/2026.2/open-http-requests-collection.png)

> **Note:**
> Refer to [Exploring the HTTP request syntax](exploring-http-syntax.html) to learn more about the syntax.

### Convert cURL requests

If you are working with [cURL](https://curl.haxx.se) requests, you can convert between cURL requests and the HTTP request in Editor format.

Procedure: Convert cURL to HTTP request

* Paste the cURL request into an HTTP request file. IntelliJ IDEA will convert it to the HTTP request format and leave the original cURL request commented out for later reference.

![cURL request converted to HTTP request on paste](https://resources.jetbrains.com.cn/help/img/idea/2026.2/aqua_http_client_convert_curl_on_paste.png)

* Alternatively, click ![Convert cURL to HTTP request](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.import.svg) on top of the HTTP request editor panel and select Convert cURL to HTTP Request.

In the Convert cURL to HTTP Request dialog, type or paste the cURL request that you want to convert.

![the Convert cURL to HTTP Request dialog](https://resources.jetbrains.com.cn/help/img/idea/2026.2/aqua_convert_curl_request_dialog.png)

Consider the following example cURL request:

```SHELL
curl 'https://httpbin.org/' -H 'Connection: keep-alive' -H 'Accept: text/html' -H 'Accept-Encoding:
gzip, deflate' -H 'Accept-Language: en-US,en;q=0.9,es;q=0.8'
```

IntelliJ IDEA will convert it to the following:

```HTTP_REQUEST_FULL
# curl 'http://httpbin.org/' -H 'Connection: keep-alive' -H 'Accept: text/html' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.9,es;q=0.8'
GET http://httpbin.org/
Connection: keep-alive
Accept: text/html
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9,es;q=0.8

###
```

The converter supports the following cURL options:

|  Option  |  Description  |
| --- | --- |
|  [-X, --request](https://curl.haxx.se/docs/manpage.html#-X)  | The request method to use. |
|  [-H, --header](https://curl.haxx.se/docs/manpage.html#-H)  | The request header to include in the request. |
|                                  [-u, --user](https://curl.haxx.se/docs/manpage.html#-u)       [--basic](https://curl.haxx.se/docs/manpage.html#--basic)       [--digest](https://curl.haxx.se/docs/manpage.html#--digest)                          | The user's credentials to be provided with the request, and the authorization method to use.  |
|                                  [-d, --data, --data-ascii](https://curl.haxx.se/docs/manpage.html#-d)       [--data-binary](https://curl.haxx.se/docs/manpage.html#--data-binary)       [--data-raw](https://curl.haxx.se/docs/manpage.html#--data-raw)       [--data-urlencode](https://curl.haxx.se/docs/manpage.html#--data-urlencode)                          | The data to be sent in a POST request. |
|  [-F, --form](https://curl.haxx.se/docs/manpage.html#-F)  | The multipart/form-data message to be sent in a POST request.  |
|  [--url](https://curl.haxx.se/docs/manpage.html#--url)  | The URL to fetch (mostly used when specifying URLs in a config file). |
|  [-i, --include](https://curl.haxx.se/docs/manpage.html#-i)  | Defines whether the HTTP response headers are included in the output. |
|  [-v, --verbose](https://curl.haxx.se/docs/manpage.html#-v)  | Enables the verbose operating mode. |
|  [-L, --location](https://curl.haxx.se/docs/manpage.html#-L)  | Enables resending the request in case the requested page has moved to a different location. |

Procedure: Convert HTTP request to cURL

1. Place the caret at the HTTP request that you want to convert to cURL format.

2. Press `Alt+Enter` (Windows), `⌥ ⏎` (macOS), `⌥ ⏎` (IntelliJ IDEA Classic (macOS)), `⌥ ⏎` (macOS System Shortcuts), `Alt+Enter` (XWin), `Alt+Enter` (GNOME), `Alt+Enter` (KDE), `Alt+Enter` (Emacs), `Alt+Enter` (Sublime Text), `⌥ ⏎` (Sublime Text (macOS)), `Alt+Enter` (NetBeans), `Alt+Enter` (Visual Studio), `⌥ ⏎` (Visual Studio (macOS)), `Ctrl+1` (Eclipse), `⌘ 1` (Eclipse (macOS)) and select Convert to cURL and copy to clipboard.

Alternatively, you can click the Convert shortcut link on top of the HTTP request editor panel and select Convert HTTP Request Under Caret to cURL and Copy.

This will generate a cURL request based on the HTTP request and copy it to the clipboard.

### Import Postman collections and environments

Postman collections is a way to group related HTTP requests together. In Postman, you can export collections as well as variables in JSON format. With the HTTP Client, you can import such files to IntelliJ IDEA to convert them to the respective `.http` and environment files.

Procedure: Import Postman collections to HTTP Client

1. [Export a collection from Postman](https://learning.postman.com/docs/getting-started/importing-and-exporting/exporting-data/). You can also export environment files if you want to use them in IntelliJ IDEA.

2. Import the file to IntelliJ IDEA in one of the following ways:

* If the exported file is in your project, right-click it and select Convert Collection to .http File.

* Open any `.http` file, click ![Import HTTP Request](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.import.svg) in the toolbar, and select Postman Collection.

* Press `Ctrl+Shift+A` (Windows), `⌘ ⇧ A` (macOS), `⌘ ⇧ A` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ P` (macOS System Shortcuts), `Ctrl+Shift+A` (XWin), `Ctrl+Shift+A` (GNOME), `Ctrl+Shift+A` (KDE), `Escape, X` (Emacs), `Ctrl+Shift+P` (Sublime Text), `⌘ ⇧ P` (Sublime Text (macOS)), `Ctrl+I` (NetBeans), `Ctrl+Shift+A` (Visual Studio), `⌘ ⇧ A` (Visual Studio (macOS)), `Ctrl+Shift+A` (Eclipse), `⌘ 3` (Eclipse (macOS)), start typing `Import from Postman Collection File`, and select the corresponding action.

3. If you also want to import an environment file, select Attach environment and specify the file. It will be converted to the HTTP Client environment format, and this environment will be selected for the specified `.http` file.

4. In the window that appears, click Convert.

![Import from Postman window](https://resources.jetbrains.com.cn/help/img/idea/2026.2/http_client_import_from_postman.png)

> **Note:**
> You can also quickly import Postman collections by dragging the collection file from your file manager to the IntelliJ IDEA editor area. Instead of just opening the file in the editor, IntelliJ IDEA will convert it to an `.http` file with corresponding requests in it.

### Generate requests using context action

You can quickly generate an HTTP request if you have a URL starting with `http` or `https` in your code string literals or in JSON, YAML, TOML, and Properties files.

Procedure:

1. Click a URL and press `Alt+Enter` (Windows), `⌥ ⏎` (macOS), `⌥ ⏎` (IntelliJ IDEA Classic (macOS)), `⌥ ⏎` (macOS System Shortcuts), `Alt+Enter` (XWin), `Alt+Enter` (GNOME), `Alt+Enter` (KDE), `Alt+Enter` (Emacs), `Alt+Enter` (Sublime Text), `⌥ ⏎` (Sublime Text (macOS)), `Alt+Enter` (NetBeans), `Alt+Enter` (Visual Studio), `⌥ ⏎` (Visual Studio (macOS)), `Ctrl+1` (Eclipse), `⌘ 1` (Eclipse (macOS)).

2. In the context menu that opens, click  Generate request in HTTP Client .

![Generate request in HTTP Client](https://resources.jetbrains.com.cn/help/img/idea/2026.2/aqua_http_generate_from_context.png)

This will create a new GET HTTP request to the specified URL in the `generated-requests.http` scratch file.

### Create requests from OpenAPI specifications

When working with [OpenAPI Specification](openapi.html) files, you can create HTTP requests to the specified endpoints.

Procedure: Create an HTTP request to an endpoint

* In an OpenAPI specification file, click ![the Open in HTTP Client button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/swagger.icons.endpointGutter.svg) in the editor gutter next to the endpoint definition.

* Alternatively, open `View | Tool Windows | Endpoints` , right-click an endpoint, and select Generate Request in HTTP Client.

IntelliJ IDEA will create a new HTTP request and save it in the `generated-requests.http` [scratch file](#creating-http-request-files).

If you want to quickly send a request to an endpoint and do not want to save it, you can use the HTTP Client tab in the Endpoints tool window.

IntelliJ IDEA provides completion for the request URL and for the request body (in JSON format) based on the available OpenAPI specifications. This applies not only to local, but also to remote specifications ([add them in the IDE settings](openapi.html#remote-spec) to enable completion).

![Body completion](https://resources.jetbrains.com.cn/help/img/idea/2026.2/openapi_body_completion.animated.gif)

> **Tip:**
> Similarly, you can create an HTTP request from your endpoint source code by clicking the corresponding gutter icon in the editor, for example ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.icons.web.newui.requestMapping.svg) in JAX-RS and [Micronaut](micronaut.html#controller) endpoints or ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/spring.icons.expui.gutter.requestMapping%4014x14.svg) in [Spring](spring-support-tutorial.html#create-controller) controllers.

Procedure: Rename an endpoint and its usages

Use the [Rename refactoring](rename-refactorings.html) to rename the defined endpoint and its usages in HTTP requests simultaneously.

1. Do any of the following:

* In an OpenAPI specification file, place the caret at the endpoint's definition you want to rename.

* In an HTTP request file, place the caret at the URL path segment you want to rename.

2. Select `Refactor | Rename` from the main menu or the context menu, or press `Shift+F6` (Windows), `⇧ F6` (macOS), `⇧ F6` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ R` (macOS System Shortcuts), `Shift+F6` (XWin), `Shift+F6` (GNOME), `Shift+F6` (KDE), `Shift+F6` (Emacs), `Shift+F6` (Sublime Text), `⇧ F6` (Sublime Text (macOS)), `Ctrl+R` (NetBeans), `Ctrl+R, R` (Visual Studio), `⌘ R, R` (Visual Studio (macOS)), `Alt+Shift+R` (Eclipse), `⇧ F6` (Eclipse (macOS)).

3. In the Rename dialog that opens, specify the new endpoint's name.

4. Preview and apply changes.

IntelliJ IDEA will rename the endpoint and its usages.

### Use response handler and pre-request scripts

With response handler scripts, you can programmatically react to a received HTTP response. By using these scripts, you can automatically process the received data as well as validate it against the conditions that you specify. Response handler scripts are provided as a part of the request within the HTTP request file and are executed as soon as a response is received. To view the response handling examples, open the Requests with Authorization or Requests with Tests and Scripts [requests collections](#open-requests-collection).

With pre-request scripts, you can set [variables used in HTTP requests](http-client-variables.html#per_request_variables).

Procedure: Insert response handler scripts

You can insert a response handler script into your request in-place or by referring to an external file.

* To insert the script in-place, prepend it with `>` and enclose it in `{% %}`:

```HTTP_REQUEST_FULL
GET host/api/test

> {%
// Response Handler Script
...
%}
```

* To insert the script from an external file, prepend it with `>`:

```HTTP_REQUEST_FULL
GET host/api/test

> scripts/my-script.js
```

If there is any output from the response handler script (errors or output from [client.log](http-client-reference.html#client-methods)), it is shown in the Response Handler tab of the Services tool window when you run the request.

Procedure: Insert pre-request scripts

You can insert a pre-request script into your request in-place or by referring to an external file.

* To insert the script in-place, prepend it with `<` and enclose it in `{% %}`:

```HTTP_REQUEST_FULL
< {%
    request.variables.set("petName", "Bella")
%}
POST https://example.org/pets/{{petName}}
```

* To insert the script from an external file, prepend it with `<`:

```HTTP_REQUEST_FULL
< scripts/my-script.js

POST https://example.org/pets/{{petName}}
```

If there is any output from the pre-request script (errors or output from [client.log](http-client-reference.html#client-methods)), it is shown in the Pre-request Handler tab of the Services tool window when you run the request.

Procedure: Import JavaScript code

Sometimes, you may need to use specific functionalities, such as variables or functions, from external files. For this, in pre-request and response handler scripts, you can use the regular ES6 import feature to access variables and functions defined in local JavaScript files.

* Export the needed values from a JavaScript file. The HTTP Client supports `export` statements in the following formats:

```JAVASCRIPT
export let name1, name2/*, … */; // also var
export const name1 = 1, name2 = 2/*, … */; // also var, let
export function functionName() { /* … */ }

export { name1, /* …, */ nameN };
export { variable1 as name1, variable2 as name2, /* …, */ nameN };

export default expression;
export default function functionName() { /* … */ }
export default function () { /* … */ }
```

* Import the needed values into your response handler or pre-request script. The HTTP Client supports `import` statements in the following formats:

```JAVASCRIPT
import defaultExport from "module-name";
import * as name from "module-name";
import { export1 } from "module-name";
import { export1 as alias1 } from "module-name";
import { export1, export2 } from "module-name";
import { export1, export2 as alias2, /* … */ } from "module-name";
import defaultExport, { export1, /* … */ } from "module-name";
import defaultExport, * as name from "module-name";
import "module-name"; // side effect import
```

> **Note:**
> If you want to run some tests from an external file and do not need to import anything from them, you can use [side effect import](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#import_a_module_for_its_side_effects_only) in your response handler script, for example `import 'test-scripts/mytests'`. This can be useful if you have common tests and want to reuse them in multiple requests while also keeping the ability to write (or import) individual tests for some requests.

* Place the `import` statement inside a common block declaration `={% ... %}` at the top of the current `.http` file to make the JavaScript module available to all pre-request scripts and response handlers in that file.

Example `logger.js`:

```JAVASCRIPT
export const logMessage = () => {
    console.log("Request executed");
};
```

Example `.http` file:

```JAVASCRIPT
                ={%
import { logMessage } from "logger"
%}

###
< {%
    logMessage();
%}

GET https://examples.http-client.intellij.net/get

> {%
    logMessage();
%}
```

Response handler scripts and pre-request scripts are written in JavaScript ECMAScript 2023, with coding assistance and documentation handled by the bundled `HTTP Pre-Request and Response Handler` library. For in-place scripts, this functionality is enabled automatically. For external scripts, you need to enable it manually.

Procedure: Enable JavaScript coding assistance for response handler and pre-request scripts

1. Press `Ctrl+Shift+A` (Windows), `⌘ ⇧ A` (macOS), `⌘ ⇧ A` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ P` (macOS System Shortcuts), `Ctrl+Shift+A` (XWin), `Ctrl+Shift+A` (GNOME), `Ctrl+Shift+A` (KDE), `Escape, X` (Emacs), `Ctrl+Shift+P` (Sublime Text), `⌘ ⇧ P` (Sublime Text (macOS)), `Ctrl+I` (NetBeans), `Ctrl+Shift+A` (Visual Studio), `⌘ ⇧ A` (Visual Studio (macOS)), `Ctrl+Shift+A` (Eclipse), `⌘ 3` (Eclipse (macOS)) (Find Action).

2. Type Use JavaScript Library, click the corresponding action, and, in the context menu that opens, select HTTP Pre-Request and Response Handler.

The `HTTP Response Handler` library exposes two objects to be used for composing response handler scripts:

* The `client` object stores the session metadata, which can be modified inside the script. The `client` state is preserved until you close IntelliJ IDEA. Every variable saved in `client.global` as `variable_name` is accessible to subsequent HTTP requests as `{{variable_name}}`.

* `response` holds information about the received response: its content type, status, response body, and so on.

To open the HTTP Response Handler library in the editor, place the caret at the library object and press `Ctrl+B` (Windows), `⌘ B` (macOS), `⌘ B` (IntelliJ IDEA Classic (macOS)), `⌘ B` (macOS System Shortcuts), `Ctrl+B` (XWin), `Ctrl+B` (GNOME), `Ctrl+B` (KDE), `Ctrl+Alt+G` (Emacs), `F12` (Sublime Text), `F12` (Sublime Text (macOS)), `Ctrl+B` (NetBeans), `F12` (Visual Studio), `F12` (Visual Studio (macOS)), `F3` (Eclipse), `F3` (Eclipse (macOS)).

Response handler scripts can include tests, which lets you use the HTTP Client as a testing framework. To create a test, invoke the `client.test(testName, function)` method. Inside the test, you can assert a condition by invoking the `client.assert(condition, message)` method, for example:

```JAVASCRIPT
GET https://httpbin.org/status/200

> {%
    client.test("Request executed successfully", function() {
        client.assert(response.status === 200, "Response status is not 200");
    });
%}
```

Procedure: Navigate through .http file using the Structure tool window

If you have multiple requests in your `.http` file, the Structure tool window can be useful to quickly preview the file and navigate through it. The tool window also shows the request parts, such as headers, the request bodies, pre-request scripts, and response handler scripts.

1. Open the  Structure  tool window: `View | Tools Windows | Structure`.

Alternatively, press `Alt+7` (Windows), `⌘ 7` (macOS), `⌘ 7` (IntelliJ IDEA Classic (macOS)), `⌘ 7` (macOS System Shortcuts), `Alt+7` (XWin), `Alt+7` (GNOME), `Alt+7` (KDE), `Alt+7` (Emacs), `Alt+7` (Sublime Text), `⌘ 7` (Sublime Text (macOS)), `Ctrl+7` (NetBeans), `Ctrl+Alt+F` (Visual Studio), `⌃ ⌥ F` (Visual Studio (macOS)), `Alt+7` (Eclipse), `⌘ 7` (Eclipse (macOS)).

2. In the Structure tool window, click an HTTP method or request name, or any part of the request.

![HTTP Client Structure tool window](https://resources.jetbrains.com.cn/help/img/idea/2026.2/http_client_structure_tool_window.png)

You can also send requests from there by right-clicking it and selecting ![The Run button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.run.run.svg).

## Execute HTTP requests

Procedure: Execute single request

1. If you are going to test your own web service, make sure it is deployed and running.

2. If you have [environments](http-client-variables.html) defined, select an environment in the Run with list on top of the request's editor panel.

3. In the gutter, click ![The Run button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.run.run.svg) next to the request.

Procedure: Execute multiple requests sequentially

You can run all requests from your `.http` file at once. This can be useful for complex scenarios such as requesting particular data from a server, saving it as a [client.global](http-response-handling-examples.html#script-var-example) variable, and sending a subsequent request containing that data.

1. Open an `.http` file.

2. On top of the editor panel, click ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.actions.runAll.svg) (Run All Requests in File).

When a request is executed, IntelliJ IDEA automatically creates a dedicated temporary [HTTP Request run/debug configuration](#http-request-run-debug-configurations) for it. You can [save it as a permanent run/debug configuration](#save-temporary-http-request-run-debug-configuration) if necessary.

Procedure: Open a request in the browser

You can open an HTTP request in the browser specified on the [Web Browsers and Preview](settings-tools-web-browsers.html) page   of the Settings dialog (`Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS))).

* Press `Alt+Enter` (Windows), `⌥ ⏎` (macOS), `⌥ ⏎` (IntelliJ IDEA Classic (macOS)), `⌥ ⏎` (macOS System Shortcuts), `Alt+Enter` (XWin), `Alt+Enter` (GNOME), `Alt+Enter` (KDE), `Alt+Enter` (Emacs), `Alt+Enter` (Sublime Text), `⌥ ⏎` (Sublime Text (macOS)), `Alt+Enter` (NetBeans), `Alt+Enter` (Visual Studio), `⌥ ⏎` (Visual Studio (macOS)), `Ctrl+1` (Eclipse), `⌘ 1` (Eclipse (macOS)) and select the Open in web browser [intention action](intention-actions.html).

### Work with HTTP request run/debug configurations

When you [execute an HTTP request from the editor](#execute_request_procedure), IntelliJ IDEA automatically creates a temporary run/debug configuration with the request parameters. A temporary run/debug configuration works the same way as a permanent run/debug configuration. You can change its settings using the [Run/Debug Configuration](run-debug-configurations-dialog.html) dialog and optionally save it as permanent.

Procedure: Modify an HTTP Request run/debug configuration

1. Do any of the following:

* In the editor, right-click a request and in the context menu, select Modify Run Configuration....

* Alternatively, go to `Run | Edit Configurations` in the main menu, and select the required run/debug configuration from the HTTP Request list.

2. Change the configuration parameters where necessary:

* In the Environment list, select an [environment](http-client-variables.html) that will define the set of environment variables used in the request.

* In the File field, provide the path to the [HTTP request file](#creating-http-request-files). You can type the path manually and use path completion `Ctrl+Space` (Windows), `⌃ Space` (macOS), `⌃ Space` (IntelliJ IDEA Classic (macOS)), `⌃ Space` (macOS System Shortcuts), `Ctrl+Space` (XWin), `Ctrl+Space` (GNOME), `Ctrl+Space` (KDE), `Alt+/` (Emacs), `Ctrl+Space` (Sublime Text), `⌃ Space` (Sublime Text (macOS)), `Ctrl+Space` (NetBeans), `Ctrl+Space` (Visual Studio), `⌃ Space` (Visual Studio (macOS)), `Ctrl+Space` (Eclipse), `⌃ Space` (Eclipse (macOS)) as you type, or click ![Open from disk](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.open.svg) and select the required folder in the dialog that opens.

* If your request file contains multiple requests, in the Request list, choose the name of the request to execute.

Procedure: Save a temporary HTTP Request run/debug configuration

Do any of the following:

* In the Run/Debug Configuration selector, choose `Save <configuration name>`.

* In the Run/Debug Configuration dialog, select the configuration and click ![the Save button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.save.svg).

Procedure: Execute a request using a run/debug configuration

Do any of the following:

* In the Run/Debug Configuration selector, select the desired run configuration. Then click ![The Run button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.run.run.svg) on the main toolbar or press `Shift+F10` (Windows), `⌃ R` (macOS), `⇧ F10` (IntelliJ IDEA Classic (macOS)), `⌥ ⇧ R` (macOS System Shortcuts), `Shift+F10` (XWin), `Shift+F10` (GNOME), `Shift+F10` (KDE), `Shift+F10` (Emacs), `Shift+F10` (Sublime Text), `Shift+F10` (Sublime Text (macOS)), `F6` (NetBeans), `Ctrl+F5` (Visual Studio), `⌃ F5` (Visual Studio (macOS)), `Alt+Shift+X` (Eclipse), `⌘ ⇧ F11` (Eclipse (macOS)).

* Press `Alt+Shift+F10` (Windows), `⌃ ⌥ R` (macOS), `⌥ ⇧ F10` (IntelliJ IDEA Classic (macOS)), `⌃ ⌥ R` (macOS System Shortcuts), `Alt+Shift+F10` (XWin), `Alt+Shift+F10` (GNOME), `Alt+Shift+F10` (KDE), `Alt+Shift+F10` (Emacs), `Alt+Shift+F10` (Sublime Text), `⌃ ⌥ R` (Sublime Text (macOS)), `Alt+Shift+F10` (NetBeans), `Ctrl+Alt+Shift+R` (Visual Studio), `⌘ ⌥ ⇧ R` (Visual Studio (macOS)), `Alt+Shift+F10` (Eclipse), `⌃ ⌥ R` (Eclipse (macOS)), select the required run configuration from the list, and press `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `Enter` (NetBeans), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (Eclipse), `⏎` (Eclipse (macOS)).

## Import HTTP requests from other .http files

IntelliJ IDEA lets you import HTTP requests from other `.http` files. You can:

* [Run all HTTP requests from specified files](#run-all-requests-from-another-http-file)

* [Run specific HTTP requests from imported files](#run-specific-requests-from-another-http-file)

Click [Examples](#open-requests-collection) and select Requests with Include to get syntax examples for this feature in your IDE.

Procedure: Run all requests from another .http file

1. In your `.http` file,  enter `run` followed by the name of another `.http` that you want to include. If the file is in the same directory, enter its name. Otherwise, specify a path to it. For example:

```HTTP_REQUEST_FULL
run ./myFolder/get-requests.http
```

2. Click ![The Run button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.run.run.svg) next to `run` to send all the requests from this file.

Procedure: Run specific requests from another .http file

1. At the top of your `.http` file, enter `import` followed by the name of another `.http` that contains necessary requests.

2. Enter `run` and specify the name of the request that you want to run.

You can press `Ctrl+Space` (Windows), `⌃ Space` (macOS), `⌃ Space` (IntelliJ IDEA Classic (macOS)), `⌃ Space` (macOS System Shortcuts), `Ctrl+Space` (XWin), `Ctrl+Space` (GNOME), `Ctrl+Space` (KDE), `Alt+/` (Emacs), `Ctrl+Space` (Sublime Text), `⌃ Space` (Sublime Text (macOS)), `Ctrl+Space` (NetBeans), `Ctrl+Space` (Visual Studio), `⌃ Space` (Visual Studio (macOS)), `Ctrl+Space` (Eclipse), `⌃ Space` (Eclipse (macOS)) to view all the requests available in the imported file.

![Run specific requests from another .http file](https://resources.jetbrains.com.cn/help/img/idea/2026.2/http_client_import_other_http_requests.png)

Procedure: Override variables from imported .http files

If the imported `.http` file contains variables, you can specify or change their values for specific executions.

1. Enter `run` and specify the name of an `.http` file or a request.

2. After the name of a request or a file, enter variables in the `(@variable=value)` format. To specify multiple variables, separate them by commas. For example:

```HTTP_REQUEST_FULL
import new-requests.http

run #GET request with one var (@host=example.com)

run #GET request with two vars (@host=example.com, @user=userName)
```

## View responses from web services

When you execute an HTTP request, IntelliJ IDEA automatically saves the response into a separate file under the `.idea/httpRequests/` directory. You can view the 50 most recently stored responses and navigate to the corresponding files using the [requests history](#requests_history). If the request was executed from a scratch file, the link to its response output is also added below the original request:

![HTTP response](https://resources.jetbrains.com.cn/help/img/idea/2026.2/http_response_in_scratch.png)

Procedure: View a received response

1. Switch to the [Services tool window](services-tool-window.html), which opens automatically as soon as a response is received.

2. By default, the server response is shown in the format specified in the request header via the [content-type](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17) field. To have the response converted into another format, click ![Response view settings](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.general.show.svg) and select Text, JSON, XML, or HTML.

![HTTP response in the Services tool window](https://resources.jetbrains.com.cn/help/img/idea/2026.2/idea_http-run-response.png)

If the response contains a binary file, this file is also saved under the `.idea/httpRequests/` directory. If the response is an image, PDF, or HTML file, you can preview them right in the IDE.

Image:

Preview the image the Services tool window:

![HTTP response with an image](https://resources.jetbrains.com.cn/help/img/idea/2026.2/http_response_with_image.png)

PDF:

Preview the PDF file the Services tool window. To disable showing PDF preview in the  Services  tool window, click ![Response view settings](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.general.show.svg) and clear the Enable PDF preview inline option.

![HTTP response with a PDF](https://resources.jetbrains.com.cn/help/img/idea/2026.2/http_response_with_pdf.png)

HTML:

If the response is an HTML file, you can click Show Preview to preview it in the editor tab using the JCEF-based browser.

![HTTP response with HTML](https://resources.jetbrains.com.cn/help/img/idea/2026.2/http_response_with_html.png)

If you have a [response handler script](#using-response-handler-scripts), the results of the tests executed as part of this script are displayed in the Tests tab of the Services tool window. You can click each of the tests to quickly navigate to the test source code in the corresponding response handler script.

![The Tests tab of the Services tool window](https://resources.jetbrains.com.cn/help/img/idea/2026.2/http-request-failed-tests.png)

If you subscribe to an event stream, IntelliJ IDEA displays events in the Services tool window. Here, you can also view the status of the client-server connection and terminate it by clicking ![Stop](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.run.stop.svg). Depending on the content type (either `text/event-stream` or `application/x-ndjson`), the response will be formatted as plain text or newline-delimited JSON. You can write a response handler script to [process each line of the event stream](http-response-handling-examples.html#stream_scripting).

![Server-sent events](https://resources.jetbrains.com.cn/help/img/idea/2026.2/http_client_json_event_stream.png)

[Redirecting](exploring-http-syntax.html#response-redirect) stream events to a file is currently not supported.

Procedure: Open a response file in the editor

1. Place the caret at the link to the response you want to open.

2. Do one of the following:

* In the main menu, go to `View | Jump to Source`.

* Press `Ctrl+B` (Windows), `⌘ B` (macOS), `⌘ B` (IntelliJ IDEA Classic (macOS)), `⌘ B` (macOS System Shortcuts), `Ctrl+B` (XWin), `Ctrl+B` (GNOME), `Ctrl+B` (KDE), `Ctrl+Alt+G` (Emacs), `F12` (Sublime Text), `F12` (Sublime Text (macOS)), `Ctrl+B` (NetBeans), `F12` (Visual Studio), `F12` (Visual Studio (macOS)), `F3` (Eclipse), `F3` (Eclipse (macOS)) or `F4` (Windows), `⌘ ↓` (macOS), `F4` (IntelliJ IDEA Classic (macOS)), `F4` (macOS System Shortcuts), `F4` (XWin), `F4` (GNOME), `F4` (KDE), `F4` (Emacs), `F4` (Sublime Text), `F4` (Sublime Text (macOS)), `F4` (NetBeans), `F4` (Visual Studio), `⌘ ↓` (Visual Studio (macOS)), `F12` (Eclipse), `F3` (Eclipse (macOS)).

* In the Services tool window or in the editor (for scratch files), `Ctrl+Click` (Windows), `Ctrl+Click` (macOS), `Ctrl+Click` (IntelliJ IDEA Classic (macOS)), `Ctrl+Click` (macOS System Shortcuts), `Ctrl+Click` (XWin), `Ctrl+Click` (GNOME), `Ctrl+Click` (KDE), `Ctrl+Click` (Emacs), `Ctrl+Click` (Sublime Text), `Ctrl+Click` (Sublime Text (macOS)), `Ctrl+Click` (NetBeans), `Ctrl+Click` (Visual Studio), `Ctrl+Click` (Visual Studio (macOS)), `Ctrl+Click` (Eclipse), `Ctrl+Click` (Eclipse (macOS)) the link in the response line.

Procedure: Extract data from JSON response using JSONPath

The HTTP Client supports JSONPath queries, enabling you to parse and extract data from received JSON documents. To do this, use the following function in your [response handler script](#using-response-handler-scripts):

```HTTP_REQUEST_FULL
jsonPath(ObjectToParse, JSONPathExpression)
```

Use the `jsonPath` live template to quickly insert this function.

1. After the request, in the response handler script part, start typing `> jsonPath`.

2. Press `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `Enter` (NetBeans), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (Eclipse), `⏎` (Eclipse (macOS)) to expand the live template and complete the JSONPath expression.

For example, this expression will retrieve and print the value of the `title` field of the first element within the `slides` array, which is a part of the `slideshow` object:

```HTTP_REQUEST_FULL
GET https://examples.http-client.intellij.net/json

> {%
    client.log(jsonPath(response.body, "$.slideshow.slides[0].title",))
%}
```

Preview the obtained value in the Response Handler tab of the Services tool window.

Procedure: Extract data from XML response using XPath

The HTTP Client supports XPath expressions, enabling you to parse and extract data from received XML documents.

1. In your [response handler script](#using-response-handler-scripts), use the following function:

```HTTP_REQUEST_FULL
xpath(XMLToParse, XPathExpression)
```

2. In `XMLToParse` enter the XML content to be parsed (for example, `response.body`), and in `XPathExpression` enter your XPath expression.

For example:

```HTTP_REQUEST_FULL
GET https://examples.http-client.intellij.net/xml

> {%
    client.log(xpath(response.body, '//slide[@type="all"][1]/title/text()'))
%}
```

Procedure: Compare responses in a scratch file

When a request is executed from a scratch file, the link to the response output file is added below the original request.

* Do any of the following:

* Place the caret at the link to the response file. Press `Alt+Enter` (Windows), `⌥ ⏎` (macOS), `⌥ ⏎` (IntelliJ IDEA Classic (macOS)), `⌥ ⏎` (macOS System Shortcuts), `Alt+Enter` (XWin), `Alt+Enter` (GNOME), `Alt+Enter` (KDE), `Alt+Enter` (Emacs), `Alt+Enter` (Sublime Text), `⌥ ⏎` (Sublime Text (macOS)), `Alt+Enter` (NetBeans), `Alt+Enter` (Visual Studio), `⌥ ⏎` (Visual Studio (macOS)), `Ctrl+1` (Eclipse), `⌘ 1` (Eclipse (macOS)) and select the Compare with <response name> intention action.

* Click ![Compare responses](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.vcs.diff.svg) in the gutter and select Compare with <response name> from the list: ![Compare responses in request history](https://resources.jetbrains.com.cn/help/img/idea/2026.2/ps_compare_responses_menu.png)

Procedure: Compare responses in the request history

When a request is executed from a physical file, the link to the response output is added to the [requests' history](#requests_history).

1. Place the caret at the link to the response file. In the main menu, go to `View | Jump to Source`, or press  `Ctrl+B` (Windows), `⌘ B` (macOS), `⌘ B` (IntelliJ IDEA Classic (macOS)), `⌘ B` (macOS System Shortcuts), `Ctrl+B` (XWin), `Ctrl+B` (GNOME), `Ctrl+B` (KDE), `Ctrl+Alt+G` (Emacs), `F12` (Sublime Text), `F12` (Sublime Text (macOS)), `Ctrl+B` (NetBeans), `F12` (Visual Studio), `F12` (Visual Studio (macOS)), `F3` (Eclipse), `F3` (Eclipse (macOS)) or `F4` (Windows), `⌘ ↓` (macOS), `F4` (IntelliJ IDEA Classic (macOS)), `F4` (macOS System Shortcuts), `F4` (XWin), `F4` (GNOME), `F4` (KDE), `F4` (Emacs), `F4` (Sublime Text), `F4` (Sublime Text (macOS)), `F4` (NetBeans), `F4` (Visual Studio), `⌘ ↓` (Visual Studio (macOS)), `F12` (Eclipse), `F3` (Eclipse (macOS)) to open this file in a new editor tab.

2. Go to `View | Compare With` in the main menu, or press `Ctrl+D` (Windows), `⌘ D` (macOS), `⌘ D` (IntelliJ IDEA Classic (macOS)), `⌘ D` (macOS System Shortcuts), `Ctrl+D` (XWin), `Ctrl+D` (GNOME), `Ctrl+D` (KDE), `Ctrl+D` (Emacs), `Ctrl+D` (Sublime Text), `⌘ D` (Sublime Text (macOS)), `Ctrl+D` (NetBeans), `Ctrl+D` (Visual Studio), `⌘ D` (Visual Studio (macOS)), `Ctrl+D` (Eclipse), `⌘ D` (Eclipse (macOS)). IntelliJ IDEA will prompt you to open a response file from the `httpRequests` folder.

3. Select the response file you would like to compare the current file with and click Open.

The two response files will be opened in the [Diff Viewer](differences-viewer.html) allowing you to compare their contents.

![Compare HTTP responses](https://resources.jetbrains.com.cn/help/img/idea/2026.2/compare_http_responses_diff.png)

## View request history

IntelliJ IDEA automatically saves the 50 recently executed requests into the `http-requests-log.http` file, which is stored on the project level under the `.idea/httpRequests/` directory. With requests history, you can quickly navigate to a particular response as well as [issue any request again](#run_request). If a request is issued again from the request history, its execution information and the link to the response output are added to the top of the request history file.

> **Note:**
> To prevent saving a request to the request history, add a comment line with the [@no-log](exploring-http-syntax.html#enable-disable-saving-request) tag before the request. This can be helpful in case a request contains some sensitive data, and you don't want to log it.

Procedure: Open request history

* Click ![Show HTTP request history](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.history.svg) on top of the request's editor panel.

* Select `Tools | HTTP Client | Show HTTP Requests History` from the main menu.

Procedure: Redirect output to a custom file or directory

* The HTTP Client can redirect output to a custom file or directory. It supports two operators for force and soft redirects:

* The `>>` operator always creates a new file, adding an `-n` suffix to a filename if the requested filename already exists.

* The `>>!` operator rewrites the file if it already exists.

## Manage cookies

The cookies received through a response are automatically saved into the dedicated `http-client.cookies` file under the `.idea/httpRequests/` directory. The number of cookies that can be saved is limited to 300. The name and value of a cookie are automatically included in each subsequent request to the URL that matches the domain and path specified for the cookie, provided that the expiry date has not been reached.

If you want a cookie to never expire, you can enter `-1` as the `date` parameter. For example:

```HTTP_REQUEST_FULL
# domain path name value date

.example.com / userId 0x4d2 -1
```

![the http-cookies file](https://resources.jetbrains.com.cn/help/img/idea/2026.2/ps_http_cookie.png)

> **Note:**
> You can prevent saving the received cookie to the cookie jar by adding a comment line with the [@no-cookie-jar](exploring-http-syntax.html#enable-disable-saving-cookies) tag before the request.

If you want to set custom cookies in an HTTP request, you can use the `Cookie` header. Enter your cookies as a list of `name=value` pairs separated by a semicolon, for example:

```HTTP_REQUEST_FULL
GET http://localhost:80/api
Cookie: theme=dark; country=France
```

## gRPC requests

> **Note:**
> To work with gRPC requests,  you need to install and enable the following plugins: [Protocol Buffers](https://plugins.jetbrains.com/plugin/14004-protocol-buffers) and [gRPC](https://plugins.jetbrains.com/plugin/16889-grpc).

The HTTP Client supports gRPC requests. For the HTTP Client to treat your requests as gRPC requests, start them with the `GRPC` keyword.

Based on a `.proto` file, IntelliJ IDEA provides completion for gRPC: all known gRPC services, unary and server-streaming methods of a particular server, and fields of accepted messages in the request body. If you don’t have a `.proto` file in your project, code completion can still be available if a server supports [gRPC reflection](https://github.com/grpc/grpc/blob/master/doc/server-reflection.md), which provides HTTP clients with information about accessible services.

![HTTP Client supports gRPC requests](https://resources.jetbrains.com.cn/help/img/idea/2026.2/http_client_supports_g_rpc_requests.animated.gif)

Procedure: Generate a gRPC request from proto files

* In the proto file, click ![gRPC](https://resources.jetbrains.com.cn/help/img/idea/2026.2/grpc.icons.procedure.svg) Generate request in HTTP Client near the RPC method.

![Generate a gRPC request from PROTO files](https://resources.jetbrains.com.cn/help/img/idea/2026.2/go_generate_a_g_rpc_request_from_proro_files.animated.gif)

Procedure: Generate a gRPC request from Endpoints tool window

Just like for HTTP requests, you can also use the Endpoints tool window to generate gRPC requests.

1. Open the Endpoints tool window: `View | Tool Windows | Endpoints`. You will see gRPC endpoints if they are defined in your project.

2. Select an endpoint. This will generate a sample request to it in the HTTP Client tab.

3. Complete the request and click Submit Request. You may need to substitute the default address and port with your own values. For the request body, use code completion based on the data structure in the proto file.

4. Preview the response in the lower part of the the HTTP Client tab.

![the HTTP Client tab](https://resources.jetbrains.com.cn/help/img/idea/2026.2/endpoints_grpc_request_response.png)

Procedure: Send gRPC metadata

* Below your `GRPC` request, enter gRPC metadata using the following syntax: `Metadata-key: Value`.

For example:

```HTTP_REQUEST_FULL
GRPC localhost:8080
X-Myhostname: Example.org
```

Procedure: Use secure gRPC

You can initiate connections secured by server-side TLS.

* Before the address, enter `grpcs`, for example:

```HTTP_REQUEST_FULL
GRPC grpcs://ijhttp-examples.jetbrains.com/hello.HelloService/SayHello
```

> **Tip:**
> Specifying the client-side certificate is currently not supported in gRPC requests.

> **Note:**
> Currently, the supported RPC types that can be executed in the HTTP Client are unary and server-streaming. Like in ordinary HTTP requests, the request body and responses are plain JSON files.

## WebSocket requests

The HTTP Client supports WebSocket requests. For the HTTP Client to treat your request as a WebSocket request, start it with the `WEBSOCKET` keyword followed by a server address. The request has the following structure:

```HTTP_REQUEST_FULL
WEBSOCKET ws://localhost:8080/websocket
Content-Type: application/json // Used for content highlighting only

// Request body, for example:
{
  "message": "First message sent on connection"
}
===  // message separator
{
  "message": "Second message" // will be sent right after the previous one
}
=== wait-for-server  // keyword used to wait for the server response
{
  "message": "Send this after the server response"
}
```

> **Note:**
> While the `Content-Type` header is not used in WebSocket connections, you can use it IntelliJ IDEA WebSocket requests to highlight syntax of transmitted data.

To speed up composing a WebSocket request, you can:

* Click ![The Add Request button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.add.svg) on top of the editor panel of an `.http` file and select WebSocket Request.

* In an `.http` file, type `wsr` and press `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `Enter` (NetBeans), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (Eclipse), `⏎` (Eclipse (macOS)) to apply the WebSocket live template.

Procedure: Send multiple messages

* Use the `===` separator to send multiple messages:

```JSON
{
  "message": "First message sent on connection"
}
===  // message separator
{
  "message": "Second message"
}
===
{
  "message": "Third message"
}
```

Procedure: Send messages after the server response

* Before a message, enter `=== wait-for-server`.

This will make the HTTP Client wait for the server response before sending the message. You can wait for multiple responses by repeating the `=== wait-for-server` line. For example, the following message will be sent after 3 server responses:

```JSON
=== wait-for-server
=== wait-for-server
=== wait-for-server
{
  "message": "This messages is sent after 3 server responses"
}
```

Procedure: Send messages interactively

Once you have initiated a connection, you can interact with your server right from the Services tool window. You can send messages and view server responses to each new message.

1. In the Services tool window, select an opened connection.

2. In the lower part of the window, under Message to be sent to WebSocket, enter the message content.

3. To the right of it, select the message format: plain text, JSON, XML, or HTML.

4. Press `Ctrl+Enter` (Windows), `⌘ ⏎` (macOS), `⌘ ⏎` (IntelliJ IDEA Classic (macOS)), `⌘ ⏎` (macOS System Shortcuts), `Ctrl+Enter` (XWin), `Ctrl+Enter` (GNOME), `Ctrl+Enter` (KDE), `Ctrl+Enter` (Emacs), `Ctrl+Enter` (Sublime Text), `⌘ ⏎` (Sublime Text (macOS)), `Ctrl+Enter` (NetBeans), `Ctrl+Enter` (Visual Studio), `⌘ ⏎` (Visual Studio (macOS)), `Ctrl+Enter` (Eclipse), `⌘ ⏎` (Eclipse (macOS)) to send the request.

In the upper part of the window, you'll see the server response.

![The Services tool window](https://resources.jetbrains.com.cn/help/img/idea/2026.2/websocket_interactive.png)

## GraphQL

IntelliJ IDEA provides support for sending GraphQL operations in the HTTP request body. You can send them over HTTP or [WebSocket](#websocket).

> **Tip:**
> For the GraphQL language support in the request body (syntax highlighting, quick navigation to schemas, and so on), you can install and enable the [GraphQL](https://plugins.jetbrains.com/plugin/8097-graphql) plugin.

Procedure: Compose an HTTP request with GraphQL query

1. In an `.http` file, enter the `GRAPHQL` keyword followed by a server address.

2. In the request body, compose your GraphQL operation (query, mutation, or subscription), for example:

```HTTP_REQUEST_FULL
### HTTP request with GraphQL query
GRAPHQL http://localhost:8080/graphql

query {
  toDos {
    title,
    completed,
    author {
      username
    }
  }
}
```

To speed up composing an HTTP request with a GraphQL query, you can:

* Click ![The Add Request button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.add.svg) on top of the editor panel of an `.http` file and select GraphQL Query Request.

* In an `.http` file, type `gqlr` and press `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `Enter` (NetBeans), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (Eclipse), `⏎` (Eclipse (macOS)) to apply the GraphQL live template.

Procedure: Use GraphQL variables

In the HTTP request body, you can use GraphQL variables if you want to pass some dynamic data separately from the query string.

* After the query part, enter a JSON variables dictionary:

```JAVASCRIPT
query ($name: String!, $capital: String!) {
  country(name: $name, capital: $capital) {
    name
    capital
  }
}

{
  "name": "France",
  "capital": "Paris"
}
```

You can also use [HTTP Client environment variables](http-client-variables.html) as GraphQL variable values. For example, in this JSON, `"{{Author}}"` is an environment variable; its value at runtime depends on the environment that you select while sending the request:

```JSON
{
  "author": "{{Author}}"
}
```

> **Note:**
> You can quickly add a variable block to the GraphQL query by pressing `Alt+Enter` (Windows), `⌥ ⏎` (macOS), `⌥ ⏎` (IntelliJ IDEA Classic (macOS)), `⌥ ⏎` (macOS System Shortcuts), `Alt+Enter` (XWin), `Alt+Enter` (GNOME), `Alt+Enter` (KDE), `Alt+Enter` (Emacs), `Alt+Enter` (Sublime Text), `⌥ ⏎` (Sublime Text (macOS)), `Alt+Enter` (NetBeans), `Alt+Enter` (Visual Studio), `⌥ ⏎` (Visual Studio (macOS)), `Ctrl+1` (Eclipse), `⌘ 1` (Eclipse (macOS)) (Show Context Actions) in the request body and selecting Add GraphQL JSON variables block.

Procedure: Create GraphQL request from Spring controller

If you use GraphQL in your Spring applications, you can quickly create HTTP requests from your controller source code using the dedicated gutter icon.

> **Tip:**
> To use this feature, install and enable the [GraphQL](https://plugins.jetbrains.com/plugin/8097-graphql) and [Spring GraphQL](https://plugins.jetbrains.com/plugin/22807-spring-graphql) plugins.
>
>
>
> IntelliJ IDEA [suggests installing](managing-plugins.html#suggested-plugins) the Spring GraphQL plugin if it detects GraphQL dependencies in your Spring project.

1. In your Spring controller code, click ![GraphQL gutter icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/icons.newui.graphql.svg) in the gutter next to the `@QueryMapping`, `@MutationMapping`, or `@SubscriptionMapping` annotation.

2. In the context menu that opens, select Generate request in HTTP Client.

![Generating HTTP request from Spring GraphqL](https://resources.jetbrains.com.cn/help/img/idea/2026.2/http_client_create_graphql_from_spring.png)

This will add a new `GRAPHQL` request to the `generated-requests.http` file.

## Configure proxy settings

Procedure:

1. In the Settings dialog (`Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS))), choose System Settings under  Appearance & Behavior, then choose HTTP Proxy.

2. In the [HTTP Proxy](settings-http-proxy.html) dialog that opens, select Manual proxy configuration and specify the following:

* Enter the proxy host name and port number in the Host name and Port number fields.

* To enable authorization, select the Proxy authentication checkbox and type the username and password in the corresponding fields.

## Set up client SSL/TLS certificate

If an HTTP server requires SSL/TLS authentication for secure communication, you may need to specify the client certificate before sending an HTTPS request. In the HTTP Client, you can set up the client certificate using the [private environment file](http-client-variables.html).

> **Tip:**
> Currently, configuring an SSL/TLS certificate is not supported in [HTTP
> Client CLI](http-client-cli.html) (you can vote for the feature request in [IJPL-69643](https://youtrack.jetbrains.com/issue/IJPL-69643/HttpClient-add-certificate-support-in-CLIrunner)). The only supported SSL-related setting in HTTP Client CLI is the [ability to disable certificate
> verification](#disable_certificate_verification).

Procedure: Specify path to certificate

1. In an `.http` file, in the Run with list, select Add Environment to Private File….

2. In the `http-client.private.env.json` file that opens, add the `SSLConfiguration` object to the needed environment. In `clientCertificate`, enter a path to your client certificate. If a certificate key is stored in a separate file, enter its path in `clientCertificateKey`. For example:

```JSON
{
    "dev": {
        "MyVar": "SomeValue",
        "SSLConfiguration": {
            "clientCertificate": "cert.pem",
            "clientCertificateKey": "MyFolder/key.pem"
        }
    }
}
```

> **Tip:**
> You can specify an absolute path or a path relative to the `http-client.private.env.json` file. If the environment file is stored in scratches, you can additionally specify a path relative to your project root. Start typing a path to get the code completion popup.

Alternatively, you can describe `clientCertificate` and `clientCertificateKey` as objects, which lets you specify the certificate format in addition to the path. For example:

```JSON
{
    "dev": {
        "SSLConfiguration": {
            "clientCertificate": {
                "path": "file.crt",
                "format": "PEM"
            },
            "clientCertificateKey": {
                "path": "file.key",
                "format": "DER"
            }
        }
    }
}
```

Procedure: Set up a certificate passphrase

If you used a passphrase when generating your client certificate, you should provide it to the HTTP Client.

1. In the `http-client.private.env.json` file, add `"hasCertificatePassphrase": true` to the `SSLConfiguration` object, for example:

```JSON
{
    "dev": {
        "SSLConfiguration": {
            "clientCertificate": "file.crt",
            "hasCertificatePassphrase": true
        }
    }
}
```

2. Click ![Set value for certificate passphrase](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.edit.svg) in the gutter or, with the caret placed at `hasCertificatePassphrase`, press `Alt+Enter` (Windows), `⌥ ⏎` (macOS), `⌥ ⏎` (IntelliJ IDEA Classic (macOS)), `⌥ ⏎` (macOS System Shortcuts), `Alt+Enter` (XWin), `Alt+Enter` (GNOME), `Alt+Enter` (KDE), `Alt+Enter` (Emacs), `Alt+Enter` (Sublime Text), `⌥ ⏎` (Sublime Text (macOS)), `Alt+Enter` (NetBeans), `Alt+Enter` (Visual Studio), `⌥ ⏎` (Visual Studio (macOS)), `Ctrl+1` (Eclipse), `⌘ 1` (Eclipse (macOS)) and select Set value for 'Certificate passphrase'.

3. In the window that opens, enter your certificate passphrase.

![HTTP Client Secured Value window](https://resources.jetbrains.com.cn/help/img/idea/2026.2/http_client_set_passphrase.png)

You can omit the second step if you do not want to enter the passphrase now. In this case, IntelliJ IDEA will prompt you to enter the passphrase when you execute an HTTPS request.

Procedure: Disable certificate verification

For development purposes, you may have a host with self-signed or expired certificates. If you trust this host, you can disable verification of its certificate.

* In the `http-client.private.env.json` file, add `verifyHostCertificate": false` to the `SSLConfiguration` object. For example:

```JSON
{
    "sslTest": {
        "SSLConfiguration": {
            "verifyHostCertificate": false
        }
    }
}
```

If you run a request with this environment, IntelliJ IDEA will not verify host certificates.

### `SSLConfiguration` reference

|  Attribute  |  Type  |  Description  |
| --- | --- | --- |
|  `clientCertificate`  | String or object |     Soecify the client certificate to send to the server: either a path to the certificate file, or an object with the `path` and `format` attributes.       The supported formats are `PEM`, `P12`, and `DER`. If you omit `format`, the HTTP Client detects it from the file extension: `.pem` and `.crt` resolve to `PEM`, `.p12`, `.pkcs12`, and `.pfx` resolve to `P12`, `.der` and `.cer` resolve to `DER`. For any other extension, specify the format explicitly.     |
|  `clientCertificateKey`  | String or object |     Specify the private key of the client certificate, if the key is stored in a separate file: either a path to the key file, or an object with the `path` and `format` attributes. Use this attribute together with `clientCertificate`.       The supported formats are `PEM` and `DER`. If you omit `format`, the HTTP Client detects it from the file extension: `.pem` and `.key` resolve to `PEM`, and `.der` resolves to `DER`. For any other extension, specify the format explicitly.     |
|  `hasCertificatePassphrase`  | Boolean |     Specify whether the client certificate is protected with a passphrase. The default value is `false`.       If you set it to `true`, IntelliJ IDEA asks you for the passphrase instead of reading it from the environment file. Use this attribute together with `clientCertificate`. For more details, refer to [Set up a certificate passphrase](#passphrase).     |
|  `verifyHostCertificate`  | Boolean |     Specify whether to verify the certificate of the host that you send requests to. The default value is `true`.       If you set it to `false`, IntelliJ IDEA accepts any host certificate. Refer to [Disable certificate verification](#disable_certificate_verification).     |

> **Note:**
> IntelliJ IDEA reads `SSLConfiguration` only from the `http-client.private.env.json` file. In `http-client.env.json`, it is treated as a regular variable and has no effect on request execution.

## See also

### Procedures

[RESTful web services](restful-webservices.html)

