MCPcopy Create free account
hub / github.com/1buran/rHttp / setReqForm

Method setReqForm

main.go:429–452  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

427}
428
429func (m *model) setReqForm() {
430 var s1, s2 []string
431 name := m.inputs[form].Value()
432 val := m.inputs[formVal].Value()
433 if name != "" && val != "" {
434 if formValues.Get(name) != "" {
435 formValues.Set(name, val)
436 } else {
437 formValues.Add(name, val)
438 }
439 for k, v := range formValues {
440 s1 = append(s1, k)
441 s2 = append(s2, strings.Join(v, ", "))
442 }
443 m.inputs[form].SetSuggestions(s1)
444 m.inputs[formVal].SetSuggestions(s2)
445 m.req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
446 m.inputs[method].SetValue("POST")
447 m.req.Method = "POST"
448 m.reqPayload = formPayload
449 m.inputs[form].Reset()
450 m.inputs[formVal].Reset()
451 }
452}
453
454func (m *model) setReqMethod() {
455 defer func() {

Callers 1

UpdateMethod · 0.95

Calls 2

ValueMethod · 0.80
ResetMethod · 0.80

Tested by

no test coverage detected