MCPcopy
hub / github.com/caddyserver/caddy / Post

Method Post

modules/caddyhttp/reverseproxy/fastcgi/client.go:292–311  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

290// Post issues a POST request to the fcgi responder. with request body
291// in the format that bodyType specified
292func (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)

Callers 5

sendFcgiFunction · 0.95
RoundTripMethod · 0.95
PostFormMethod · 0.95
PostFileMethod · 0.95

Calls 1

RequestMethod · 0.95

Tested by 2

sendFcgiFunction · 0.76