main.go 339 B

12345678910111213141516171819202122232425
  1. package main
  2. import (
  3. "io"
  4. "net/http"
  5. "os"
  6. )
  7. func main(){
  8. res, err := http.Get("http://192.168.1.57:8083/excel/ceshi")
  9. if err != nil {
  10. panic(err)
  11. }
  12. tem :=res.Header.Get("Content-Disposition")
  13. println("=============",tem)
  14. f, err := os.Create("D:/1.xlsx")
  15. if err != nil {
  16. panic(err)
  17. }
  18. io.Copy(f, res.Body)
  19. f.Close()
  20. }