MCPcopy Index your code
hub / github.com/bitfield/script / ExamplePipe_Post

Function ExamplePipe_Post

script_test.go:2494–2506  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2492}
2493
2494func ExamplePipe_Post() {
2495 ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
2496 data, err := io.ReadAll(r.Body)
2497 if err != nil {
2498 log.Fatal(err)
2499 }
2500 fmt.Fprintf(w, "You said: %s", data)
2501 }))
2502 defer ts.Close()
2503 script.Echo("hello").Post(ts.URL).Stdout()
2504 // Output:
2505 // You said: hello
2506}
2507
2508func ExamplePipe_Read() {
2509 buf := make([]byte, 12)

Callers

nothing calls this directly

Calls 4

EchoFunction · 0.92
StdoutMethod · 0.80
PostMethod · 0.80
CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…