Created
March 28, 2024 09:15
-
-
Save chopeen/f4e0f4a9b188d520da9d289acaee0e49 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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