MCPcopy Create free account
hub / github.com/devld/go-drive / AppendField

Method AppendField

script/call_http.go:93–103  ·  view source on GitHub ↗
(key string, v any)

Source from the content-addressed store, hash-verified

91}
92
93func (fd *formData) AppendField(key string, v any) {
94 var data []byte
95 if str, ok := v.(string); ok {
96 data = []byte((str))
97 } else if b := GetBytes(v); b != nil {
98 data = b
99 } else {
100 fd.vm.ThrowTypeError("AppendField: value must be string or Bytes")
101 }
102 fd.data = append(fd.data, formDataField{key, "", data})
103}
104
105func (fd *formData) AppendFile(key, filename string, reader any) {
106 var r io.Reader

Callers

nothing calls this directly

Calls 2

GetBytesFunction · 0.85
ThrowTypeErrorMethod · 0.80

Tested by

no test coverage detected