MCPcopy Index your code
hub / github.com/LumaAI-API/Luma-API / DoRequest

Function DoRequest

request.go:47–78  ·  view source on GitHub ↗
(method, url string, body io.Reader, otherHeaders map[string]string)

Source from the content-addressed store, hash-verified

45}
46
47func DoRequest(method, url string, body io.Reader, otherHeaders map[string]string) (*http.Response, error) {
48 headers := map[string]string{
49 "Cookie": GetLumaAuth(),
50 }
51 for k, v := range CommonHeaders {
52 headers[k] = v
53 }
54 for k, v := range otherHeaders {
55 headers[k] = v
56 }
57
58 req, err := http.NewRequest(method, url, body)
59 if err != nil {
60 return nil, err
61 }
62 defer func() {
63 if body != nil {
64 req.Body.Close()
65 }
66 }()
67
68 for k, v := range headers {
69 req.Header.Set(k, v)
70 }
71
72 resp, err := HTTPClient.Do(req)
73 if err != nil {
74 return nil, err
75 }
76 HandleRespCookies(resp)
77 return resp, nil
78}

Callers 9

FetchByIDFunction · 0.85
GetDownloadUrlFunction · 0.85
ChatCompletionsFunction · 0.85
fetchTaskFunction · 0.85
doGenerationFunction · 0.85
uploadFileFunction · 0.85
getSignedUploadFunction · 0.85
getMeFunction · 0.85
getUsageFunction · 0.85

Calls 2

GetLumaAuthFunction · 0.85
HandleRespCookiesFunction · 0.85

Tested by

no test coverage detected