MCPcopy Index your code
hub / github.com/simstudioai/sim / buildHeaders

Function buildHeaders

apps/sim/lib/api/client/request.ts:102–116  ·  view source on GitHub ↗
(headers: unknown, hasBody: boolean)

Source from the content-addressed store, hash-verified

100}
101
102function buildHeaders(headers: unknown, hasBody: boolean): Record<string, string> {
103 const output: Record<string, string> = {}
104
105 if (hasBody) {
106 output['Content-Type'] = 'application/json'
107 }
108
109 if (headers && typeof headers === 'object') {
110 for (const [key, value] of Object.entries(headers as Record<string, unknown>)) {
111 if (typeof value === 'string') output[key] = value
112 }
113 }
114
115 return output
116}
117
118function parseOptionalSchema<S extends ApiSchema | undefined>(
119 schema: S,

Callers 2

requestJsonFunction · 0.70
requestRawFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected