MCPcopy Create free account
hub / github.com/coder/coder / NewRequestPayload

Function NewRequestPayload

aibridge/intercept/responses/reqpayload.go:46–55  ·  view source on GitHub ↗
(raw []byte)

Source from the content-addressed store, hash-verified

44type RequestPayload []byte
45
46func NewRequestPayload(raw []byte) (RequestPayload, error) {
47 if len(bytes.TrimSpace(raw)) == 0 {
48 return nil, xerrors.New("empty request body")
49 }
50 if !json.Valid(raw) {
51 return nil, xerrors.New("invalid JSON payload")
52 }
53
54 return RequestPayload(raw), nil
55}
56
57func (p RequestPayload) Stream() bool {
58 return gjson.GetBytes(p, reqPathStream).Bool()

Calls 3

RequestPayloadTypeAlias · 0.70
NewMethod · 0.65
ValidMethod · 0.65