MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / postForm

Function postForm

internal/agent/hitl_magic_api_test.go:102–113  ·  view source on GitHub ↗

postForm submits a form-encoded POST to the given URL and returns the response. Mirrors what a browser does when the confirmation page's form is submitted.

(t *testing.T, url string, values map[string]string)

Source from the content-addressed store, hash-verified

100// response. Mirrors what a browser does when the confirmation page's
101// form is submitted.
102func postForm(t *testing.T, url string, values map[string]string) *http.Response {
103 t.Helper()
104 form := make(map[string][]string, len(values))
105 for k, v := range values {
106 form[k] = []string{v}
107 }
108 resp, err := http.PostForm(url, form)
109 if err != nil {
110 t.Fatal(err)
111 }
112 return resp
113}
114
115// --- GET confirmation page behavior ---
116

Calls 1

makeFunction · 0.85

Tested by

no test coverage detected