Skip to content
/ jurl Public

CLI Java application to provides an API test/client tool.

License

Notifications You must be signed in to change notification settings

gfarfanb/jurl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jurl CI

jurl

CLI Java application to provide an API test/client tool.

What do you need for execute it

Installation

  • 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

As executable by system

  • 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

How to use it

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

PokéAPI - The RESTful Pokémon API

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

Config tricks

Create or edit the <WORKING_DIR>/config/config.json file to specify default values:

Field Value
openEditorCommand
  • /usr/bin/subl \"{{HTTP/response.path}}\"
  • \"%PROGRAMFILES%\\Sublime Text\\subl.exe\" \"{{~win-separator~HTTP/response.path}}\"
downloadsLocation
  • $HOME/Downloads
  • %USERPROFILE%\\Downloads

Example:

{
    "openEditorCommand": "/usr/bin/subl \"{{HTTP/response.path}}\"",
    "downloadsLocation": "$HOME/Downloads"
}

Contribution

Follow this project's Contribution guidelines.

License

Copyright © 2023-2024, Giovanni Farfán B.. Released under the MIT License.

About

CLI Java application to provides an API test/client tool.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages