-
Notifications
You must be signed in to change notification settings - Fork 6
/
http_windows.go
38 lines (30 loc) · 867 Bytes
/
http_windows.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//go:build windows
package winhttp
import (
"io"
"net/http"
"net/url"
)
// DefaultClient is the default client similar to net/http.
var DefaultClient *Client
// Get will make a GET request using the DefaultClient.
func Get(url string) (*http.Response, error) {
return DefaultClient.Get(url)
}
// Head will make a HEAD request using the DefaultClient.
func Head(url string) (*http.Response, error) {
return DefaultClient.Head(url)
}
func init() {
DefaultClient, _ = NewClient()
}
// Post will make a POST request using the DefaultClient.
func Post(
url string, contentType string, body io.Reader,
) (*http.Response, error) {
return DefaultClient.Post(url, contentType, body)
}
// PostForm will make a POST request using the DefaultClient.
func PostForm(url string, data url.Values) (*http.Response, error) {
return DefaultClient.PostForm(url, data)
}