package main
import (
"io"
"log"
"net/http"
"os"
"strings"
)
func main() {
username := "kermit"
modelname := "mymodel"
apikey := "foobar"
url := "https://scienceops.yhathq.com/" + username + "/models/" + modelname + "/"
input := `{"input":"here"}`
req, err := http.NewRequest("POST", url, strings.NewReader(input))
if err != nil {
log.Fatal(err)
}
req.SetBasicAuth(username, apikey)
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
io.Copy(os.Stdout, resp.Body)
}
-
Notifications
You must be signed in to change notification settings - Fork 0
yhat/yhat-go
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Go client for the ScienceOps API
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published