MCPcopy Create free account
hub / github.com/chromedp/examples / setheaders

Function setheaders

headers/main.go:59–66  ·  view source on GitHub ↗

setheaders returns a task list that sets the passed headers.

(host string, headers map[string]interface{}, res *string)

Source from the content-addressed store, hash-verified

57
58// setheaders returns a task list that sets the passed headers.
59func setheaders(host string, headers map[string]interface{}, res *string) chromedp.Tasks {
60 return chromedp.Tasks{
61 network.Enable(),
62 network.SetExtraHTTPHeaders(network.Headers(headers)),
63 chromedp.Navigate(host),
64 chromedp.Text(`#result`, res, chromedp.ByID, chromedp.NodeVisible),
65 }
66}
67
68const indexHTML = `<!doctype html>
69<html>

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected