top

Package gofight offers simple API http handler testing for Golang framework.

Details about the gofight project are found in github page:

https://github.com/appleboy/gofight

Installation:

$ go get -u github.com/appleboy/gofight

Set Header: You can add custom header via SetHeader func.

SetHeader(gofight.H{
  "X-Version": version,
})

POST FORM Data: Using SetFORM to generate form data.

SetFORM(gofight.H{
  "a": "1",
  "b": "2",
})

POST JSON Data: Using SetJSON to generate json data.

SetJSON(gofight.H{
  "a": "1",
  "b": "2",
})

POST RAW Data: Using SetBody to generate raw data.

SetBody("a=1&b=1")

For more details, see the documentation and example.

Imports 4 package(s)

  1. github.com/labstack/echo/engine
  2. github.com/labstack/echo
  3. github.com/stretchr/testify/assert
  4. github.com/labstack/echo/test

Test imports 3 package(s)

  1. github.com/appleboy/gofight/framework
  2. github.com/buger/jsonparser
  3. github.com/gin-gonic/gin