GithubHelp home page GithubHelp logo

wklken / fetch Goto Github PK

View Code? Open in Web Editor NEW
17.0 4.0 3.0 1.48 MB

A command line http test tool. Maintain the case via git and pure text

Home Page: https://wklken.me/fetch/

License: Apache License 2.0

Go 99.45% Makefile 0.31% Dockerfile 0.24%
newman httptest apitest cli

fetch's Introduction

fetch

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.

Installation

Binary releases

See the available binaries for different operating systems/architectures from the releases page.

go install

go install github.com/wklken/fetch@latest

hombrew

brew tap wklken/fetch
brew install fetch

docker

docker 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

Build from source

  • dependencies: go1.21
git clone https://github.com/wklken/fetch.git
cd fetch
make build

Getting Started

request:
  method: get
  url: 'http://httpbin.org/get'
assert:
  status: ok
  statusCode: 200
  contentLength_gt: 180
  contentType: application/json

run

$ ./fetch run http_get.yaml

See examples for a variety of examples.

Features

  • 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: -v or set export FETCH_DEBUG = true
    • quiet mode: -q/--quiet to silent the print, for check $? only
    • run in order / run in parallel
    • set failFast/timeout

Feedback

If you have any feedback, please create an issue

License

Copyright (c) 2021-present wklken

Licensed under MIT License

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.