Skip to content

Commit baa569f

Browse files
committed
Created statement that is sending HTTP request
1 parent 6ef05d4 commit baa569f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

main.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ package main
22

33
import (
44
"fmt"
5+
"os"
6+
"os/exec"
57
)
68

79
func main() {
8-
910
var url string
1011
var method string
1112
var option string
@@ -42,6 +43,10 @@ func main() {
4243
fmt.Scan(&option)
4344
if ynToBool(option) {
4445
fmt.Println("Sending request")
46+
cmd := exec.Command("curl", "-X", method, url)
47+
cmd.Stdin = os.Stdin
48+
cmd.Stdout = os.Stdout
49+
cmd.Run()
4550
} else {
4651
fmt.Println("Do you want to save request to file? [y/n]")
4752
fmt.Scan(&option)

0 commit comments

Comments
 (0)