main.go 464 B

12345678910111213141516171819202122
  1. package main
  2. import (
  3. "./PhalApiClient"
  4. "fmt"
  5. "net/url"
  6. )
  7. func main() {
  8. rs, err := PhalApiClient.NewRequest().
  9. WithHost(`http://127.0.0.1/PhalApi/Public/index.php`).
  10. WithService("Default.index").
  11. WithParams(url.Values{}).
  12. Get()
  13. if err != nil {
  14. fmt.Println(err.Error())
  15. } else {
  16. fmt.Println("code------------------------", rs.Code)
  17. fmt.Println("data------------------------", rs.Data)
  18. fmt.Println("msg------------------------", rs.Msg)
  19. }
  20. }