curl-ko-jadu
The curl-ko-jadu extension for Visual Studio Code provides an intuitive interface to send and manage curl requests directly from within the editor. It simplifies making and testing API requests, allowing for quick modifications, reuse, and execution of curl commands.
Features
- Create variables: easily store multiple variables to reuse in your curl request.
- Comment support: You can document your requets with comments
- Execute curl Commands: Send HTTP requests directly from VS Code using curl.
- Support multiple commands: You can have multiple types of command in the same file.
- Save and Reuse Commands: Store frequently used curl requests for later use.
- Integrated Output: View API responses directly in the VS Code with formatting.
- Every terminal commands: Though mainly designed for curl. You can execute any terminal commands with benefit of added variables
For example:
Tip: Check out the extension in action by testing a variety of curl commands with different parameters.
Requirements
- VS Code Version: 1.50.0 or later
- Curl: Ensure you have Curl installed on your machine.
To install curl, follow the instructions on the Curl download page.
How to use
- Create a file with
.curl
extension
- Define variables
@baseUrl=http://localhost:8000/api/v1
@auth={{baseUrl}}/auth
---
@baseUrl=http://localhost:8000 # comments can be placed here too
# you can write easily write comments like this
@baseUrl=http://localhost:8000
# put a single command between the delimeters
---
curl -s {{baseUrl}}
---
# You can run above command by clicking inside the command region and `cmd + shift + p` and search for `startCurl` and then run the command.
# I recommend assigning a shortcut to the `curl-ko-jadu.startCurl` for easier access.
@baseUrl=http://localhost:8000/api/v1
@authUrl={{baseUrl}}/auth
# Create a new user route
---
curl -s {{authUrl}}/signup
-H 'Accept: application/json'
-H 'Content-Type: application/json'
-d '
{
"name": "user",
"email: "user@curlkojadu.com",
"password":"securestuff" # user a better password.
# Comments can be inserted here too
}
'
---
# Check for health
curl -s {{baseUrl}}/health
---
# for multi line curl no need to insert \ after each line
# comment can be outside or inside the command section