Skip to content

Commit

Permalink
Update xrpc client close
Browse files Browse the repository at this point in the history
  • Loading branch information
onanying committed Aug 1, 2023
1 parent c69dd5c commit 99dede2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/xrpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ client := &http.Client{
TLSClientConfig: tlsConf,
},
}
defer client.CloseIdleConnections()
resp, err := client.Post("https://127.0.0.1:50001/v1/request_for_release", "application/json", strings.NewReader(`{"order_number":"123456789"}`))
fmt.Println(resp.Body)
```
Expand Down
1 change: 1 addition & 0 deletions src/xrpc/rpcclient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func TestNewGatewayTLSClient(t *testing.T) {
TLSClientConfig: tlsConf,
},
}
defer client.CloseIdleConnections()
resp, err := client.Post("https://127.0.0.1:50001/v1/request_for_release", "application/json", strings.NewReader(`{"order_number":"123456789"}`))
b, _ := io.ReadAll(resp.Body)
fmt.Println(string(b), err)
Expand Down

0 comments on commit 99dede2

Please sign in to comment.