You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
with streaming enabled: (streaming gives live response data back.)
go run . [-H key:value] [-stream true/false] [URL]
(important to note that you can include 1 of many flags while testing aswell, but make sure to always include the URL at the end).
include response body logging:
go run . [-b true/false -s 1024] [URL]
(important to note you can set a limit on the response body size to log (positive values only), as with the -s flag, if you want it to be the default (1024), simply do not include the flag).
session mode:
Instead of manually pasting, you can enter session mode to dynamically store urls, headers, etc in a variable and then use that variable to test API's (in which the variable will hold the header/url etc).
to enter session mode, run the following:
go run . [-session true/false]
when entering session mode, the url does not need to be present at the end.
session mode tutorial:
start off by setting a variable to hold a url/header or such.
VAR [VarName] [Value]
and to retrieve a variable:
GET [VarName]
and it returns the value of whatever the variable stores.
to delete a variable, run:
DEL [VarName]
to see all stored variables:
FETCH
view all available commands whilst your in session mode:
HELP
using the variables you stored for API testing:
(for standard get requests):
TEST [VarName]
if you a custom header aswell, do so in the following format:
TEST [VarName] [-h headerName:value]
you can also make POST/GET requests as so:
TEST [VarName] [-x GET]
and post request like so:
TEST [VarName] [-x POST -D [bodyData]]
for post requests, when setting a request body you can do -F for form related data, or -D for normal json data as shown above, you can use the -F flag like so:
be sure to include the "-c" flag as it is the number of requests that are to be sent to the api, with the json data that should be provided in the "-d" flag.
and for get requests:
SPAM [VarName] [-x GET] [-c 10]
important to note that you can include an variable as the argument to the "-c" flag, though make sure the variables value is an integer.
to exit session mode:
EXIT
and make sure you use the exact format as shown, (title:value).
also important, you can include multiple flag options at once when testing (except -F and -D for -x POST).
VarName should be a variable assigned with a valid url, however for session mode, you can store headers/body data/urls in variables to utilise them when using the TEST/SPAM cmd.
About
curl-like tool built in go for API testing, includes concurrency testing, streaming live data, etc.