Skip to content

Instantly share code, notes, and snippets.

@chopeen
Created March 28, 2024 09:15
Show Gist options
  • Select an option

  • Save chopeen/f4e0f4a9b188d520da9d289acaee0e49 to your computer and use it in GitHub Desktop.

Select an option

Save chopeen/f4e0f4a9b188d520da9d289acaee0e49 to your computer and use it in GitHub Desktop.
package main
import (
"io/ioutil"
"log"
"net/http"
)
func main() {
resp, err := http.Get("https://ollama.com/token?nonce=wxlLnVBWIaC0XGORVmYxbg&scope=repository%3Alibrary%2Fqwen%3Apull&service=ollama.com&ts=1711615900")
if err != nil {
log.Fatalln(err)
}
//We Read the response body on the line below.
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Fatalln(err)
}
//Convert the body to type string
sb := string(body)
log.Printf(sb)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment