1
lewis0xx001 OP body, err := ioutil.ReadAll(res.Body)
fmt.Println("post send success") fmt.Printf("type is %T\n", body) 结果: post send success type is []uint8 <?xml version="1.0" encoding="utf-8" ?><returnsms> <errorstatus> <error>2</error> <remark>sign 参数错误</remark> </errorstatus> </returnsms> |
2
lewis0xx001 OP @lewis0xx001
<?xml version="1.0" encoding="utf-8" ?><returnsms> <errorstatus> <error>2</error> <remark>sign 参数错误</remark> </errorstatus> </returnsms> 是 string() 后的打印结果 |
3
lewis0xx001 OP 直接打印 body 是
body is []byte{0x3c, 0x3f, 0x78, 0x6d, 0x6c, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x31, 0x2e, 0x30, 0x22, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x3d, 0x22, 0x75, 0x74, 0x66, 0x2d, 0x38, 0x22, 0x20, 0x3f, 0x 3e, 0x3c, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x6d, 0x73, 0x3e, 0xa, 0x20, 0x3c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x3e, 0xa, 0x20, 0x3c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x3e, 0x32, 0x3c, 0x2f, 0x65, 0x72, 0x7 2, 0x6f, 0x72, 0x3e, 0xa, 0x20, 0x3c, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x3e, 0x73, 0x69, 0x67, 0x6e, 0xe5, 0x8f, 0x82, 0xe6, 0x95, 0xb0, 0xe9, 0x94, 0x99, 0xe8, 0xaf, 0xaf, 0x3c, 0x2f, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x3e, 0xa, 0x20, 0x3c , 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x3e, 0xa, 0x20, 0x3c, 0x2f, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x6d, 0x73, 0x3e, 0xa, 0x20} |
4
lewis0xx001 OP 有没有大佬给个思路呀
|
5
haohu108123 2022-11-10 15:19:02 +08:00
这个其实网上一搜 一大堆。
|
6
herold519 2022-11-10 17:01:40 +08:00
鸟哥那图谁来贴一下?
|
7
yaott2020 2022-11-10 17:27:21 +08:00 via Android
自己搜:golang xml 解析,网上一抓一大把
|