CLI Java application to provide an API test/client tool.
- Choose and download a release version (ZIP file jurl-X.X.X.zip)
- Decompress ZIP file and test it
rem Windows
jurl -h
# Linux
./jurl -h
- Set JURL_HOME environment variable based on the location of the jurl-X.X.X.jar
- Add JURL_HOME to PATH enrivonment variable
Windows
Edit the environment variables
Variable | Value |
---|---|
JURL_HOME | jurl JAR location |
Path | %Path%;%JURL_HOME% |
rem Restart command prompt
jurl -h
Linux
Add/modify the environment variables in ~/.bashrc file
vim ~/.bashrc
# vim>
# export JURL_HOME="<jurl-jar-location>"
# export PATH=$PATH:$JURL_HOME
source ~/.bashrc
# Set execution permissions to *jurl* bash file
chmod +x $JURL_HOME/jurl
jurl -h
Define a spec file (no specific extension is required)
pokemon-api
@default-request = pokemon
### [request] pokemon
GET https://pokeapi.co/api/v2/pokemon/{{name}}
output pokemonId = {{OUT/id}}
### [request] encounters
@method = GET
@host = https://pokeapi.co
@basePath = /api/v2
@endpoint = /pokemon/{{pokemonId}}/encounters
Execute request
jurl -s name "gengar" pokemon-api
According to the spec, after the request the variable
pokemonId
will have the ID of the requested Pokémon
Execute a request by name
jurl -n encounters pokemon-api
Create or edit the <WORKING_DIR>/config/config.json
file to specify default values:
Field | Value |
---|---|
openEditorCommand |
|
downloadsLocation |
|
Example:
{ "openEditorCommand": "/usr/bin/subl \"{{HTTP/response.path}}\"", "downloadsLocation": "$HOME/Downloads" }
Follow this project's Contribution guidelines.
Copyright © 2023-2024, Giovanni Farfán B.. Released under the MIT License.