api_tool.go 585 B

123456789101112131415161718192021222324
  1. package services
  2. import (
  3. "fmt"
  4. "github.com/rdlucklib/rdluck_tools/http"
  5. "net/url"
  6. )
  7. const (
  8. RefreshUrl = "http://127.0.0.1:7007/mysteel_chemical/refresh"
  9. )
  10. func MysteelChemicalRefresh(filePath string) {
  11. var refreshUrl string
  12. //filePathStr:=url.PathEscape(filePath)
  13. refreshUrl = RefreshUrl + "?FilePath=" + url.QueryEscape(filePath)
  14. fmt.Println("MysteelChemicalRefresh URL:"+refreshUrl)
  15. body, err := http.Get(refreshUrl)
  16. if err != nil {
  17. fmt.Println("MysteelChemicalRefresh Err:" + err.Error())
  18. return
  19. }
  20. fmt.Println("MysteelChemicalRefresh Result:" + string(body))
  21. }