Mensa-API/fetch/fetch.go

17 lines
296 B
Go
Raw Permalink Normal View History

2024-03-27 16:41:57 +00:00
package fetch
import (
"net/http"
"net/url"
)
func Fetch(path string) (*http.Response, error) {
2024-09-15 16:57:03 +00:00
baseurl := "https://www.imensa.de"
2024-03-27 16:41:57 +00:00
queryurl := baseurl + "/" + path
u, err := url.ParseRequestURI(queryurl)
if err != nil {
return nil, err
}
return http.Get(u.String())
}