mirror of
https://github.com/LeRoid-hub/Mensa-API.git
synced 2025-01-31 03:34:57 +00:00
17 lines
297 B
Go
17 lines
297 B
Go
package fetch
|
|
|
|
import (
|
|
"net/http"
|
|
"net/url"
|
|
)
|
|
|
|
func Fetch(path string) (*http.Response, error) {
|
|
baseurl := "https://www.imensa.de/"
|
|
queryurl := baseurl + "/" + path
|
|
u, err := url.ParseRequestURI(queryurl)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return http.Get(u.String())
|
|
}
|