通过DNS协议(UDP)
dig +short myip.opendns.com @resolver4.opendns.com
通过HTTP服务(TCP)
curl -s http://whatismyip.akamai.com/
[......]
通过DNS协议(UDP)
dig +short myip.opendns.com @resolver4.opendns.com
通过HTTP服务(TCP)
curl -s http://whatismyip.akamai.com/
[......]
go http post form(表单)
resp, err := http.PostForm("https://xxx.com/xxx", url.Values{
"x1": {"xxxxxx"},
"x2": {strings.Join(aa, ",")},
"x3": {content}})
if err != nil {
fmt.Println("phoneAlarm request error")
}
defer resp.Body.Clo[......]
func weworkAlarm(text string, mentionAll bool) {
mentionAllStr := ""
if mentionAll {
mentionAllStr = "@all"
}
dataJsonStr := fmt.Sprintf(`{"msgtype": "text", "text": {"content": "%s", "mentioned_list": [%s]}}`, text, mentionAllStr)[......]
在Retrofit 1 时,会在onError中返回并抛出HttpException,但是在2中,不会再回调onError了,而是会在onNext中,这个任务就需要客户端自己处理。
https://futurestud.io/tutorials/retrofit-2-simple-error-handling
参考如下:
Error Handler in Action
etrofit 2 has a different concept of handling "succe[......]
RT,直接访问会提示:
App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.
解决方法有2种:
参考自:http://stackoverflow.com/questions/31254725/transpo[......]