MCPcopy
hub / github.com/betty200744/ultimate-go / TestDoPost

Function TestDoPost

build-in-package/http/http_test.go:44–53  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

42 fmt.Println(string(res[:]))
43}
44func TestDoPost(t *testing.T) {
45 url := "http://dummy.restapiexample.com/api/v1/create"
46 payload := ` {
47 "name":"test",
48 "salary":"123",
49 "age":"23"
50 }`
51 res, _ := DoPost(TypeJson, url, nil, []byte(payload))
52 fmt.Println(string(res[:]))
53}
54func Test_FileServer(t *testing.T) {
55 err := http.ListenAndServe("localhost:3005", http.FileServer(http.Dir("./")))
56 if err != nil {

Callers

nothing calls this directly

Calls 1

DoPostFunction · 0.85

Tested by

no test coverage detected