MCPcopy Create free account
hub / github.com/003random/getJS / FetchResponse

Function FetchResponse

extractor/extractor.go:19–28  ·  view source on GitHub ↗

FetchResponse fetches the HTTP response for the given URL.

(u string, method string, headers http.Header)

Source from the content-addressed store, hash-verified

17
18// FetchResponse fetches the HTTP response for the given URL.
19func FetchResponse(u string, method string, headers http.Header) (*http.Response, error) {
20 req, err := http.NewRequest(method, u, nil)
21 if err != nil {
22 return nil, err
23 }
24
25 req.Header = headers
26
27 return http.DefaultClient.Do(req)
28}
29
30// ExtractSources extracts all JavaScript sources found in the provided HTTP response reader.
31// The optional extractionPoints can be used to overwrite the default extraction points map

Callers 1

ProcessURLsMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected