Skip to content

v0.3.4

Compare
Choose a tag to compare
@guonaihong guonaihong released this 18 Jan 06:18
· 18 commits to master since this release
13ff215

url 支持模板语法。

package main

import (
	"github.com/guonaihong/gout"
)

type testURLTemplateCase struct {
	Host   string
}

func main() {

	url := "https://{{.Host}}"
	// 发送GET方法
	gout.GET(url, testURLTemplateCase{Host:"www.qq.com"}).Do()

	// 发送POST方法
	gout.POST(url, testURLTemplateCase{Host:"www.github.com"}).Do()

	// 发送PUT方法
	gout.PUT(url, testURLTemplateCase{Host:"www.baidu.com"}).Do()

	// 发送DELETE方法
	gout.DELETE(url, testURLTemplateCase{Host:"www.google.com"}).Do()

	// 发送PATH方法
	gout.PATCH(url, testURLTemplateCase{Host:"www.google.com"}).Do()

	// 发送HEAD方法
	gout.HEAD(url, testURLTemplateCase{Host:"www.google.com"}).Do()

	// 发送OPTIONS
	gout.OPTIONS(url, testURLTemplateCase{Host:"www.google.com"}).Do()
}