Skip to content

Instantly share code, notes, and snippets.

@chopeen
Created March 28, 2024 09:33
Show Gist options
  • Save chopeen/a47bb9a55464acd218c6e6949823503f to your computer and use it in GitHub Desktop.
Save chopeen/a47bb9a55464acd218c6e6949823503f to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://ollama.com/token", nil)
if err != nil {
fmt.Println("Error creating request:", err)
return
}
resp, err := http.DefaultClient.Do(req)
if err != nil {
fmt.Println("Error making request:", err)
return
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Println("Error reading response body:", err)
return
}
fmt.Println("Response:", string(body))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment