gout icon indicating copy to clipboard operation
gout copied to clipboard

downfile怎么做呢?

Open xwinie opened this issue 3 years ago • 1 comments

xwinie avatar May 26 '21 16:05 xwinie

就正常发http请求就好了, 比如你要下载qq

package main

import (
	"io/ioutil"

	"github.com/guonaihong/gout"
)

func main() {

	url := "https://down.qq.com/qqweb/PCQQ/PCQQ_EXE/PCQQ2021.exe"
	var file []byte
	err := gout.GET(url).BindBody(&file).Do()
	if err != nil {
		panic(err.Error())

	}

	ioutil.WriteFile("PCQQ2021.exe", file, 0644)

}

guonaihong avatar May 27 '21 05:05 guonaihong