golang Post房管局
package main
import (
"fmt"
"io/ioutil"
"net/http"
"strings"
)
func httpPost() {
// http post请求
resp, err := http.Post("http://sfgj.ziyang.gov.cn/jyw/xf/GetBTable.ashx",
"application/x-www-form-urlencoded",
strings.NewReader("itemRecord=201903080001144&houseCode=201912260000973&qy=3"))
if err != nil {
fmt.Println(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
// handle error
fmt.Println("handle error")
}
fmt.Println(string(body))
}
func main() {
httpPost()
}
评论
隐私政策
你无需删除空行,直接评论以获取最佳展示效果