Post issues a POST request to the fcgi responder. with request body in the format that bodyType specified
(p map[string]string, method string, bodyType string, body io.Reader, l int64)
| 290 | // Post issues a POST request to the fcgi responder. with request body |
| 291 | // in the format that bodyType specified |
| 292 | func (c *client) Post(p map[string]string, method string, bodyType string, body io.Reader, l int64) (resp *http.Response, err error) { |
| 293 | if p == nil { |
| 294 | p = make(map[string]string) |
| 295 | } |
| 296 | |
| 297 | p["REQUEST_METHOD"] = strings.ToUpper(method) |
| 298 | |
| 299 | if len(p["REQUEST_METHOD"]) == 0 || p["REQUEST_METHOD"] == "GET" { |
| 300 | p["REQUEST_METHOD"] = "POST" |
| 301 | } |
| 302 | |
| 303 | p["CONTENT_LENGTH"] = strconv.FormatInt(l, 10) |
| 304 | if len(bodyType) > 0 { |
| 305 | p["CONTENT_TYPE"] = bodyType |
| 306 | } else { |
| 307 | p["CONTENT_TYPE"] = "application/x-www-form-urlencoded" |
| 308 | } |
| 309 | |
| 310 | return c.Request(p, body) |
| 311 | } |
| 312 | |
| 313 | // PostForm issues a POST to the fcgi responder, with form |
| 314 | // as a string key to a list values (url.Values) |