MCPcopy
hub / github.com/pocketbase/pocketbase / String

Method String

tools/router/event.go:165–170  ·  view source on GitHub ↗

String writes a plain string response.

(status int, data string)

Source from the content-addressed store, hash-verified

163
164// String writes a plain string response.
165func (e *Event) String(status int, data string) error {
166 e.setResponseHeaderIfEmpty(headerContentType, "text/plain; charset=utf-8")
167 e.Response.WriteHeader(status)
168 _, err := e.Response.Write([]byte(data))
169 return err
170}
171
172// HTML writes an HTML response.
173func (e *Event) HTML(status int, data string) error {

Callers 15

checkModerncDepsFunction · 0.45
SnakecaseFunction · 0.45
CamelizeFunction · 0.45
sendMethod · 0.45
html2TextFunction · 0.45
addressesToStringsFunction · 0.45
detectReaderMimeTypeFunction · 0.45
RandomStringByRegexFunction · 0.45
TestCronNewFunction · 0.45
TestCronSetTimezoneFunction · 0.45
BuildMethod · 0.45

Calls 3

WriteHeaderMethod · 0.45
WriteMethod · 0.45

Tested by 15

TestCronNewFunction · 0.36
TestCronSetTimezoneFunction · 0.36
TestEventStringFunction · 0.36
TestMessageWriteFunction · 0.36
TestWrapStdHandlerFunction · 0.36
TestWrapStdMiddlewareFunction · 0.36
TestStaticFunction · 0.36