You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

27 lines
529 B

package mcp_test
import (
"fmt"
"io/ioutil"
"net/http"
"testing"
)
func Test_Tool_Finance(t *testing.T) {
// 构建请求URL‌:ml-citation{ref="1,5" data="citationList"}
url := fmt.Sprintf("http://hq.sinajs.cn/list=%s", "sh600519")
resp, err := http.Get(url)
if err != nil {
fmt.Println(err)
return
}
defer resp.Body.Close()
// 读取响应数据‌:ml-citation{ref="6,8" data="citationList"}
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}