File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -63,22 +63,20 @@ const go = `package main
6363import (
6464 "fmt"
6565 "net/http"
66- "io/ioutil"
6766)
6867
6968func main() {
70- url := "https://upload.estuary.tech/content/add"
71- method := "POST"
69+ const url = "https://upload.estuary.tech/content/add"
7270
73- client := &http.Client {
74- }
75- req, err := http.NewRequest(method, url, nil)
71+ req, err := http.NewRequest(http.MethodPost, url, nil)
72+ if err != nil { panic(err) }
7673 req.Header.Add("Authorization", "Bearer YOUR_API_KEY")
7774 req.Header.Add("Accept", "application/json")
78- res, err := client.Do(req)
75+ res, err := http.DefaultClient.Do(req)
76+ if err != nil { panic(err) }
7977 defer res.Body.Close()
80- body , err := ioutil.ReadAll( res.Body)
81- fmt.Println(string(body))
78+ _ , err = io.Copy(os.Stdout, res.Body)
79+ if err != nil { panic(err) }
8280}` ;
8381
8482const python = `import requests
You can’t perform that action at this time.
0 commit comments