httplib: set the default proto
Showing
1 changed file
with
15 additions
and
0 deletions
| ... | @@ -79,6 +79,9 @@ func Get(url string) *BeegoHttpRequest { | ... | @@ -79,6 +79,9 @@ func Get(url string) *BeegoHttpRequest { |
| 79 | var resp http.Response | 79 | var resp http.Response |
| 80 | req.Method = "GET" | 80 | req.Method = "GET" |
| 81 | req.Header = http.Header{} | 81 | req.Header = http.Header{} |
| 82 | req.Proto = "HTTP/1.1" | ||
| 83 | req.ProtoMajor = 1 | ||
| 84 | req.ProtoMinor = 1 | ||
| 82 | return &BeegoHttpRequest{url, &req, map[string]string{}, map[string]string{}, defaultSetting, &resp, nil} | 85 | return &BeegoHttpRequest{url, &req, map[string]string{}, map[string]string{}, defaultSetting, &resp, nil} |
| 83 | } | 86 | } |
| 84 | 87 | ||
| ... | @@ -88,6 +91,9 @@ func Post(url string) *BeegoHttpRequest { | ... | @@ -88,6 +91,9 @@ func Post(url string) *BeegoHttpRequest { |
| 88 | var resp http.Response | 91 | var resp http.Response |
| 89 | req.Method = "POST" | 92 | req.Method = "POST" |
| 90 | req.Header = http.Header{} | 93 | req.Header = http.Header{} |
| 94 | req.Proto = "HTTP/1.1" | ||
| 95 | req.ProtoMajor = 1 | ||
| 96 | req.ProtoMinor = 1 | ||
| 91 | return &BeegoHttpRequest{url, &req, map[string]string{}, map[string]string{}, defaultSetting, &resp, nil} | 97 | return &BeegoHttpRequest{url, &req, map[string]string{}, map[string]string{}, defaultSetting, &resp, nil} |
| 92 | } | 98 | } |
| 93 | 99 | ||
| ... | @@ -97,6 +103,9 @@ func Put(url string) *BeegoHttpRequest { | ... | @@ -97,6 +103,9 @@ func Put(url string) *BeegoHttpRequest { |
| 97 | var resp http.Response | 103 | var resp http.Response |
| 98 | req.Method = "PUT" | 104 | req.Method = "PUT" |
| 99 | req.Header = http.Header{} | 105 | req.Header = http.Header{} |
| 106 | req.Proto = "HTTP/1.1" | ||
| 107 | req.ProtoMajor = 1 | ||
| 108 | req.ProtoMinor = 1 | ||
| 100 | return &BeegoHttpRequest{url, &req, map[string]string{}, map[string]string{}, defaultSetting, &resp, nil} | 109 | return &BeegoHttpRequest{url, &req, map[string]string{}, map[string]string{}, defaultSetting, &resp, nil} |
| 101 | } | 110 | } |
| 102 | 111 | ||
| ... | @@ -106,6 +115,9 @@ func Delete(url string) *BeegoHttpRequest { | ... | @@ -106,6 +115,9 @@ func Delete(url string) *BeegoHttpRequest { |
| 106 | var resp http.Response | 115 | var resp http.Response |
| 107 | req.Method = "DELETE" | 116 | req.Method = "DELETE" |
| 108 | req.Header = http.Header{} | 117 | req.Header = http.Header{} |
| 118 | req.Proto = "HTTP/1.1" | ||
| 119 | req.ProtoMajor = 1 | ||
| 120 | req.ProtoMinor = 1 | ||
| 109 | return &BeegoHttpRequest{url, &req, map[string]string{}, map[string]string{}, defaultSetting, &resp, nil} | 121 | return &BeegoHttpRequest{url, &req, map[string]string{}, map[string]string{}, defaultSetting, &resp, nil} |
| 110 | } | 122 | } |
| 111 | 123 | ||
| ... | @@ -115,6 +127,9 @@ func Head(url string) *BeegoHttpRequest { | ... | @@ -115,6 +127,9 @@ func Head(url string) *BeegoHttpRequest { |
| 115 | var resp http.Response | 127 | var resp http.Response |
| 116 | req.Method = "HEAD" | 128 | req.Method = "HEAD" |
| 117 | req.Header = http.Header{} | 129 | req.Header = http.Header{} |
| 130 | req.Proto = "HTTP/1.1" | ||
| 131 | req.ProtoMajor = 1 | ||
| 132 | req.ProtoMinor = 1 | ||
| 118 | return &BeegoHttpRequest{url, &req, map[string]string{}, map[string]string{}, defaultSetting, &resp, nil} | 133 | return &BeegoHttpRequest{url, &req, map[string]string{}, map[string]string{}, defaultSetting, &resp, nil} |
| 119 | } | 134 | } |
| 120 | 135 | ... | ... |
-
Please register or sign in to post a comment