fetch is a lightweight and powerful API testing tool.
You can use git and yaml files to maintain all test cases.
See https://wklken.me/fetch for more information.
See the available binaries for different operating systems/architectures from the releases page.
go install github.com/wklken/fetch@latestbrew tap wklken/fetch
brew install fetchdocker run --rm --net=host wklken/fetch help
# apple m1*/m2*
docker pull --platform=linux/amd64 wklken/fetch
docker run --rm --net=host wklken/fetch help- dependencies: go1.21
git clone https://github.com/wklken/fetch.git
cd fetch
make buildrequest:
method: get
url: 'http://httpbin.org/get'
assert:
status: ok
statusCode: 200
contentLength_gt: 180
contentType: application/jsonrun
$ ./fetch run http_get.yamlSee examples for a variety of examples.
- http methods: get/post/put/delete/patch/head/options
- build request: file/template(go template)/set cookie/basic auth/share cookie/msgpack
- assert response:
- status/statusCode/contentLength/contentType/body
- latency
- numeric support
_in/_not_in/_lt/_lte/_gt/_gte - string support
_contains/_not_contains/_startswith/_endswith - proto/protoMajor/protoMinor
- redirect
- header/cookie/error/json(jmespath)/html(xpath)/xml(xpath)/yaml/toml/redirect
- cli:
- progress bar
- show stats
- verbose mode:
-vor setexport FETCH_DEBUG = true - quiet mode:
-q/--quietto silent the print, for check$?only - run in order / run in parallel
- set failFast/timeout
If you have any feedback, please create an issue
Copyright (c) 2021-present wklken
Licensed under MIT License
