rtl8720dn: add support for http.Get(), http.Post() and cookie

This commit is contained in:
sago35
2021-07-14 22:46:24 +09:00
committed by Ron Evans
parent 633f19c4ac
commit 2537c69b0f
15 changed files with 1997 additions and 175 deletions
+26
View File
@@ -0,0 +1,26 @@
package net
import "strings"
// SplitHostPort splits a network address of the form "host:port",
// "host%zone:port", "[host]:port" or "[host%zone]:port" into host or
// host%zone and port.
//
// A literal IPv6 address in hostport must be enclosed in square
// brackets, as in "[::1]:80", "[::1%lo0]:80".
//
// See func Dial for a description of the hostport parameter, and host
// and port results.
func SplitHostPort(hostport string) (host, port string, err error) {
if strings.Contains(hostport, ":") {
spl := strings.Split(hostport, ":")
host = spl[0]
port = spl[1]
} else {
host = hostport
port = "80"
}
return host, port, nil
}