Bloops things! A postman alternative that uses TOML as a configuration file. It automatically detects used variables and performs actions needed to satisfy them, such as reading from a file, making another request and pulling out values, or running an arbitrary script.
Bloops runs on MacOs, Linux, and Windows.
Bloop can be used either as a cli or as a terminal gui.
Named http requests to make
[request.florp]
uri = "http://localhost:5284/echo"
method = "POST"
body = "{}"
content_type = "application/json"
headers = { Authorization = "Bearer ${mySuperSecretToken}" }
[request.somejson]
uri = "https://stackoverflow.com/api/recent-chat"
- can contain variables
- default is
http://localhost
- default is
GET
- can contain variables
- optional request body
- optional content type
- only used if
body
is set
- values can contain variables
- optional key value pairs to be used in
application/x-www-form-urlencoded
content - if set
body
will not be used
- values can contain variables
- optional key value pairs to be sent as headers
- values can contain variables
- optional key value pairs to be added to the uri as query parameters
Variables can be used in request header values, bodies, and the uri by using ${someVariableName}
inside of the definition. Values come from various sources defined in the properties or passed to the cli with --var someKey=value,otherKey=derp
[variable.activeUsers]
source = "somejson"
jpath = "$.activeUsers"
[variable.command]
command = "./scripts/testVariableScript.ps1"
- constant literal value for a variable
- a jpath used to extract values from the reponse of
source
source
is required if this is set
- the request name that will be used to extract values
jpath
is required if this is set
- executable or script to run
- the entire stdout is used as the variable value if the command exits successfully
- optional arguments to pass to a
command
- read the contents of a file
- environment variables
- optional timespan after which a new value will be retrieved. In the format
HH:MM:SS
Useful for token expiration.
Sometimes you want to have swappable sets of variables, for example when interacting with multiple deployment environments. To support this bloop variables support environment sets. Each variable in a variable set has all the properties of a normal top level variable. The -s
or --set
cli option can be used to select an env set.
[request.someApi]
uri = "https://${host}/floob"
headers = { Authorization = "Bearer ${token}" }
[variable.host]
default = "dev.example.com"
[variableset.host.staging]
env = "STAGE_HOST"
[variableset.host.prod]
file = ".prod_host"
[variable.token]
file = ".token"
[variableset.token.staging]
command = "./getToken.ps1"
command_args = "stage"
value_lifetime = "00:10:00"
[variableset.token.prod]
command = "./getToken.ps1"
command_args = "prod"
value_lifetime = "00:03:00"
bloop someApi --set prod
[defaults]
headers = { X-Bloop = "${yep}" }
Header values that will be added to every request if not already specified
Bloop requires the latest .net for the main application, and powershell for scripts and tests
To build: dotnet build
To produce release mode outputs in the ./releases/
directory: ./scripts/buildCli.ps1
To run integration tests: ./tests/IntegrationTests/runTests.ps1