You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
335 B
19 lines
335 B
package common
|
|
|
|
import (
|
|
"io/ioutil"
|
|
"net/http"
|
|
)
|
|
|
|
//Get请求
|
|
func CurlGet(getUrl string) []byte {
|
|
client := &http.Client{}
|
|
reqest, err := http.NewRequest("GET", getUrl, nil)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
response, _ := client.Do(reqest)
|
|
defer response.Body.Close()
|
|
body, err := ioutil.ReadAll(response.Body)
|
|
return body
|
|
}
|
|
|