Export to HttpClient
EasyApi can export your API definitions as IntelliJ IDEA HttpClient .http files.
How to Export
- Open a file containing API endpoints
- Right-click in the editor > EasyApi > EXPORT > HttpClient
- An
.httpfile will be generated with all API requests
You can also export from the API Dashboard by right-clicking an endpoint and selecting Export > HTTP Client.
Export Scope
| Scope | Action |
|---|---|
| Single method | Right-click on the method > EasyApi > Export > HttpClient |
| Single class | Right-click in the class > EasyApi > Export > HttpClient |
| Multiple classes | Select files in Project view > EasyApi > Export > HttpClient |
| Entire module | Right-click on module > EasyApi > Export > HttpClient |
Output
The export generates an .http file containing HttpClient requests for each API endpoint:
http
GET http://localhost:8080/api/users
Content-Type: application/json
###
POST http://localhost:8080/api/users
Content-Type: application/json
{
"name": "test"
}Using Exported Files
- Save the exported
.httpfile to your project - Open the file in IntelliJ IDEA
- Click the run icon next to a request to execute it directly in the IDE
- Configure the HttpClient test framework for advanced testing