| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 | 
							- package main
 
- import (
 
- 	"bytes"
 
- 	"fmt"
 
- 	"io/ioutil"
 
- 	"net/http"
 
- )
 
- func main(){
 
- 	client := &http.Client{}
 
- 	body := bytes.NewBuffer([]byte("{\"username\":\"00028\",\"password\":\"123456\"}"))
 
- 	req, err := http.NewRequest("POST",
 
- 		"https://kptyun.cn:8082/auth",
 
- 		body,
 
- 	)
 
- 	req.Header.Set("Content-Type", "application/json;charset=utf-8")
 
- 	if err != nil {
 
- 		// handle error
 
- 	}
 
- 	resp, err := client.Do(req)
 
- 	if err != nil {
 
- 		fmt.Println(err)
 
- 		return
 
- 	}
 
- 	defer resp.Body.Close()
 
- 	result_body, err := ioutil.ReadAll(resp.Body)
 
- 	if err != nil {
 
- 		fmt.Println(err)
 
- 		return
 
- 	}
 
- 	fmt.Println(string(result_body))
 
- 	//resp1, err :=http.Post("https://kptyun.cn:8082/auth", "application/x-www-form-urlencoded",nil)
 
- 	//
 
- 	//
 
- 	//
 
- 	//if err != nil {
 
- 	//	fmt.Println(err)
 
- 	//}
 
- 	//
 
- 	//defer resp1.Body.Close()
 
- 	//body1, err := ioutil.ReadAll(resp1.Body)
 
- 	//if err != nil {
 
- 	//	// handle error
 
- 	//}
 
- 	//
 
- 	//fmt.Println(string(body1))
 
- }
 
 
  |